PDA

View Full Version : How to minimize to system tray?



nim
03-09-2003, 04:28 PM
Can someone tell me how to make prog minimize to system tray by clock, instead of mere minimize to taskbar?

Worm
03-09-2003, 04:57 PM
There isn't a way to do this within AMS...

But, here is a workaround that I've used.

You can use the ShowWindow function in the User32.dll to hide and show the window. Problem is there isn't a way the user can click on the hidden window to show it again. I created a C++ exe that creates a tray icon with a popup menu to restore the app. In the AMS project, I hide the window, execute the traywait.exe (with the wait until finished option), then follow it with a show window.

Kind of crude, but it does work.

Download Sample Here (http://www.warmuskerken.com/ams/traywait.zip)

Worm
03-09-2003, 05:09 PM
BTW,

If you wanted to use this and wanted a different Icon, and an actual Tooltip on the mouseover, send me the icon and the text you'd want, and I compile it for you.