🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6574

Re: Missing Tray Icon

#6574
From: Vladimir Stefanovic
Date: Mon, 02 May 2005 17:23
43 lines
2615 bytes
Thanks,

This was nice to know. I never used RegisterWindowMessage()
but I think I will succeed to implement that properly... and wait
for the crash of the "explorer.exe" to see if my app is in the
"survivors" boat.


-- 
Best regards,
Vladimir Stefanovic

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4275d933$1@newsgroups.borland.com...
>
> "Vladimir Stefanovic" <antivari@po.sbb.co.yu> wrote in message
> news:427522d4@newsgroups.borland.com...
>
>> I noticed that in some circumstances (do not know the moment)
>> a tray icon of my program is missing, although the task manager
>> says that the app is running. The funy thing is that also many other
>> tray icons are missing (not only mine) when that moment happens!
>
> That happens when the OS's shell program (explorer.exe) crashes and was
> re-started by the OS, thus every icon was lost when the System Tray was
> recreated.  Those icons that "survived" were because their respective
> applications recognized the restart and re-added their icons accordingly.
>
>> I suppose that the programs that "survived" know about that
>> problem and so has some additional code to add the icon again.
>
> Yes.  At program startup, use the RegisterWindowMessage() function to
> register the "TaskbarCreated" message.  Then override your form's 
> WndProc()
> method to catch that message.  When your form receives the message, it 
> means
> that the entire Taskbar, including the System Tray, has been recreated, so
> you can then re-add your icons at that time.
>
>
> Gambit
>
> 
Technical Details
Message-ID: <427661f2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!news.moat.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <427522d4@newsgroups.borland.com> <4275d933$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7ad711a9c0d3d8ff
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <427522d4@newsgroups.borland.com> <4275d933$1@newsgroups.borland.com>
Subject: Re: Missing Tray Icon
Date: Mon, 2 May 2005 19:23:02 +0200
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 82.117.212.65
Message-ID: <427661f2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1115054578 82.117.212.65 (2 May 2005 10:22:58 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!news.moat.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail