News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

System tray icon problem

Started by starzboy, July 13, 2009, 12:43:27 PM

Previous topic - Next topic

starzboy

Hello

I have been playing with the system tray icons and I got it working correctly until, if I crash explorer the system icon is gone but the process is still running.
What is the best ay to overcome this icon problem at times of explorer crashes.

thanks

fearless

Many traybar icon programs will loose their icons if the explorer.exe process is killed/crashes. If it is an application that has a main app window and a traybar icon part to it, you can always set a single instance for your program, if a user runs the exe again the main window is displayed. you can then set the traybar icon again in WM_INITDIALOG or/and when user minimizes the window WM_SIZE with a check on wParam (.IF wParam==SIZE_MINIMIZED). There is a macro included with the macros.asm of the MASM32 package called SetSingleInstance which you can use: SingleInstanceOnly(Offset ClassName)
Ć’earless

akane

Explorer is broadcasting a message when the taskbar is recreated, so you can catch it and insert your icon again. Call RegisterWindowMessage with "TASKBARCREATED" string and store the result (eax) in global variable like WM_TASKBARCREATED. In you WindowProc check for this message.