What is the best way to programmatically restore and give focus to a third-party application (say, GoogleTalk or Twhirl) running in the system tray? I am writing my utility in C#, but I obviously have no control over the third-party application.
+3
A:
Use something like FindWindow /FindWindowEx to find the hidden window and get its window handle and then call ShowWindow ( handle, SW_NORMAL) to unhide it.
Use a tool like Spy++ (can be found in the visual studio tools menu) to find the parameters which can be passed on to FindWindow to locate the desired window.
SDX2000
2009-02-08 22:08:52
What if the hidden window has a Handle=0?
hawbsl
2010-01-06 19:09:30
AFAIK a NULL handle represents an invalid HANDLE...FindWindow returns NULL when it fails in finding the specified window.
SDX2000
2010-01-07 19:18:07