I've used FindWindow to get a handle to a window of an external application. How can I use this handle to activate the window of the external application, if it is minimized or behind other applications on the windows desktop?
I tried ShowWindow and BringWindowToTop with no success, do they work on the windows of external processes?
Eloff
2010-08-04 23:13:07
As long as you have successfully retrieved a handle to that window.
karlphillip
2010-08-04 23:38:46
+2
A:
To prevent focus-stealing (or at least make accidental focus-stealing harder), Windows puts up some roadblocks to one process bringing another process's window to the top.
Check MSDN for SetForegroundWindow (especially in the Remarks section) and AllowSetForegroundWindow.
You should either send a message to the process to tell it to restore its own window, or that process has to explicitly allow your process to do this.
Adrian McCarthy
2010-08-04 23:47:57