Re: system tray icons lost if explorer shuts down/re-starts
From: Michel (mrodenas_at_iFrance.com)
Date: 02/13/05
- Next message: io: "MSChart Problem"
- Previous message: Tom Esh: "Re: system tray icons lost if explorer shuts down/re-starts"
- In reply to: Tom Esh: "Re: system tray icons lost if explorer shuts down/re-starts"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 13 Feb 2005 11:35:51 +0100
Tom Esh a écrit :
> On Sat, 12 Feb 2005 06:14:48 -0000, "Pedro CR"
> <pramilo@n0.spam.sapo.pt> wrote:
>
>
>>i have an app that places an icon in the system tray and the main form can
>>only be shown by clicking the icon in the systray.
>>the app ensures that it's the only instance running to prevent having
>>multiple icons in the system tray for the same purpose
>>
>>however i have a problem: if for any reason windows explorer is terminates,
>>when it re-starts the icon is no longer in the system tray but the app is
>>still running.
>>Users complain that they must reboot to get the program working again.
>>i've noticed that some software is able to recover from this problem and as
>>soon as windows explorer re-starts some icons re-appear.
>>
>>must i use some hack when I add the app to the system tray? I'm using the
>>regular NIM_ADD with flags "NIF_ICON Or NIF_MESSAGE Or NIF_TIP".
>>is there any way to work around this issue?
>
>
> Yes. When the shell re-starts it broadcasts the "TaskbarCreated"
> registered message and tray apps should respond by re-initializing
> (adding) whatever tray icons. Use the RegisterWindowMessage Api
> function at runtime to obtain the actual message value, and add a
> handler for it in your subclassed winproc.
>
> I believe the "Tray" example at http://vb.mvps.org/ demonstrates it.
>
>
> -Tom
> MVP - Visual Basic
> (please post replies to the newsgroup)
I dont remember where I've found this sample but that's exactly what you
are looking for, really really good.
Michel
- application/x-zip-compressed attachment: TrayIcon.zip
- Next message: io: "MSChart Problem"
- Previous message: Tom Esh: "Re: system tray icons lost if explorer shuts down/re-starts"
- In reply to: Tom Esh: "Re: system tray icons lost if explorer shuts down/re-starts"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|