Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restore application from system tray

Tags:

c#

process

winapi

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.

like image 940
Einar Avatar asked Feb 08 '09 13:02

Einar


1 Answers

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.

like image 133
Autodidact Avatar answered Oct 02 '22 23:10

Autodidact