PDA

View Full Version : Unmaximize application



Harry Hunt
07-08-2004, 11:01 AM
Hi!
I'm writing a program that launches an external application and then resizes it and moves it to a certain position on the screen. This works okay for applications that aren't maximized, however with apps that are maximized it doesn't work at all. So my question is: how can I force an external application to un-maximize?

I tried ShowWindow(ExtHandle, SW_SHOWNORMAL); but that doesn't work.

Thanks a bunch!

Harry Hunt
07-08-2004, 01:12 PM
Okay, I got that solved... now I have another problem.
I'm using CreateProcess to run an app and then I use EnumWindows to get the window handle. This works great with Notepad and most applications that don't have a splash screen. Is there any way to get the window handle of the actual application's window (and not the splash screen)?
Thanks again!

Paulius
07-08-2004, 07:32 PM
I guess you could try something like this: get the splash screen's thread id with GetWindowThreadProcessId, sleep while IsWindow with splash screens handle returns true and then you should get the window you want with EnumThreadWindows

Harry Hunt
07-08-2004, 08:28 PM
cool! I'll try that! thanks!