简体   繁体   中英

Restore application from system tray

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.

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.

Use an API call to send mouse click events to the system tray? Google WM_SENDMSG SendMessage Win32 API for a starting point

There's also another API call for setting focus once the window's back up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM