Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Leave icon in SysTray when pgm ends 2

Status
Not open for further replies.

koz

Programmer
Jan 12, 2000
31
US
I'm trying to write an program that will leave an icon in the system tray when it exits (kinda like MSN Messenger, etc.)

I have the code working that manipulates the system tray while the program is active but the icon disappears whe the program ends.

Any help will be greatly appreciated.
 
You can't. Program needs to remain active in some sense to maintain a presence in the system tray. MSN Messenger stays open whilst the System Tray icon is there.
 
The easiest method involves trapping attempts to close the application, canceling them, and minimizing to the tray.
 
I would be remiss if I didn't suggest you check the cause of the close event first. In some cases (like the user is logging off Windows, or they've tried killing it via Task Manager out of desperation, etc.) you'll want to really goaway.

Look in the Help for the QueryUnload event.
 
Ok, then how do I minimize the application leaving the icon in the System Tray but not having it show up on the task bar?
 
I think I have my anser in the QueryUnload Event.

Thanks for all the help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top