It annoys the crap out of me when applications do not recreate their tray icons if explorer.exe should "die" and be restarted,
so to make your PureBasic program that much better than te others out there, use this:
Code: Select all
;Put this somewhere early in the app, along with the window creation
Global taskbarrestart.l
taskbarrestart=RegisterWindowMessage_("TaskbarCreated")
Code: Select all
Procedure.l WindowCallback(hwnd,message,wparam,lparam)
Protected result.l=#PB_ProcessPureBasicEvents
Select message
Case taskbarrestart
;Tray icon recreate code here or maybe call a procedure that does this.
EndSelect
ProcedureReturn result
Endprocedure
Also, older Windows does not support this message. (should do no harm though obviously since it's just a message).
I forgot which versions, but I'm guessing Window 2000 or later, maybe Win98 not sure. Vista however seems to need some extra privileges added to your program before you get that message, not sure about a solution there.