Calendar
(c) 2005-2008 John Koerner
Contact me at blog2 at
johnkoerner dot net
|
Thursday, February 12. 2009Using the ShowWindow API on a VB6 App from .NetTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
You are not guaranteed to get the correct window handle by calling GetWindow with GW_HWNDPREV if the target application creates any forms prior to displaying the main form. In my case the target app creates a login dialog and a splash screen prior to displaying the main form. These windows are hidden but kept in memory when the main window is displayed. I have no control over this because the app is not mine. I can see with Spy++ that the previous window to the one returned from MainWindowHandle is the splash screen, the one prior to that is the login dialog and the one prior to that is main vb6 application window.
The main vb6 application window's owner is the one returned by MainWindowHandle so I'm wondering if that relationship could be used to retrieve the main window properly. Unfortunately the 'owner' of the hidden login and splash screen is also the one returned by MainWindowHandle so I can't loop backwards until I find a window that has MainWindowHandle as that owner. |
|
|||||||||||||||||||||||||||||||||||||||||||||||||