Minimize other apps to the systray

  • Thread starter Thread starter Yancey Jones
  • Start date Start date
Y

Yancey Jones

I am looking for some example code for minimizing a 3rd part app to the
system tray. I am working on writing a service to control VMWare and when a
user logs in, I would like to minimize the VMWare window(s) to the system
tray and hide it from the task bar (and of course un-hide the VMWare
windows should the user choose to do so from the system tray).

I have been searching but havent found anything yet. I am guessing that it
is possible??

Thanks,
Yancey
 
if memory serves, you can use the ShowWindow function from user32.dll

ShowWindow(hWnd,SW_MINIMIZE);

you'll probably use FindWindowEx to get the handle (HWND) for the other
window.
 
if memory serves, you can use the ShowWindow function from user32.dll

ShowWindow(hWnd,SW_MINIMIZE);

you'll probably use FindWindowEx to get the handle (HWND) for the other
window.

Getting the handle should not be a problem especially since the service
will be spawing the VMWare session.

Thanks,
Yancey
 
decorate it with a DllImport attribute and set the security to allow
calls to unmanaged code
 
Back
Top