ChrisH
asked on
Window Precedence
I have an application which has a main window, and when you press a button on the main window, other applications launch as part of the program. Now, when the applications launch, they take over focus of the program with the main program window still running in the background (which is what I desired). However, my problem is that when I select the main program, my launched application falls behind the main window. What I want to do is leave the launched application on top of the main window after clicking the main window, but I want the launched window to be gray and disabled until the user clicks on the launched window again.
Also.. I want to be able to set precedence for the different windows.. like say if window foo is open.. and window baz is open.. I want to have a way for my application to determine that baz should remain on top of foo.
Also.. I want to be able to set precedence for the different windows.. like say if window foo is open.. and window baz is open.. I want to have a way for my application to determine that baz should remain on top of foo.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is there a way to get the title name in before the findwindow call? See.. I launch a window using a Call Shell() function call based on a register value. Any thoughts?
ASKER
Is there a way to get the title name in before the findwindow call? See.. I launch a window using a Call Shell() function call based on a register value. Any thoughts?
The SetTopMostWindow function I gave you requires a Window Handle and Shell returns an Instance handle...
Check out the following microsoft KB article:
HOWTO: Find a Window Handle from an Instance Handle
http://support.microsoft.com/support/kb/articles/Q242/3/08.ASP?LNG=ENG&SA=MSDN&FR=0
Cheers!®©
Check out the following microsoft KB article:
HOWTO: Find a Window Handle from an Instance Handle
http://support.microsoft.com/support/kb/articles/Q242/3/08.ASP?LNG=ENG&SA=MSDN&FR=0
Cheers!®©
ASKER
Thanks for your help..
Thanks for the points! Glad I could help!
Cheers!®©
Cheers!®©
hWnd = FindWindow(vbNullString, "Untitled - Notepad")
if hWnd = 0 then the API did not find the window, so don't call the SetTopMostWindow function....
Cheers!®©