🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Missing Tray Icon

#6562
From: Remy Lebeau (TeamB)
Date: Mon, 02 May 2005 07:42
25 lines
2077 bytes
"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: <4275d933$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!news.maxwell.syr.edu!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <427522d4@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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <427522d4@newsgroups.borland.com>
Subject: Re: Missing Tray Icon
Date: Mon, 2 May 2005 00:42:06 -0700
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4275d933$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1115019571 68.69.17.41 (2 May 2005 00:39:31 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!news.maxwell.syr.edu!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail