Article View: borland.public.cppbuilder.nativeapi
Article #683Re: Multiple Shell_NotifyIcon calls
From: Kris
Date: Fri, 22 Feb 2008 23:33
Date: Fri, 22 Feb 2008 23:33
32 lines
2370 bytes
2370 bytes
Remy Lebeau (TeamB) wrote: > It could be that you are simply trying to add the icon before the taskbar > itself has actualy been created yet. To handle that (and to handle when the > Shell crashes and has to recreate the taskbar), you need to intercept the > "TaskbarCreated" broadcast message. Refer to the following article for more > details: > > The Taskbar > http://msdn2.microsoft.com/en-us/library/bb776822.aspx Thanks for the link. It contains very useful info. I implemented handling the TaskBarCreated message, but things sometimes still don't behave as expected. Shell crashes are handled just fine now, the message is received and I recreate my icon when necessary. However, while loading my app during Windows startup, I still notice from time to time that NIM_ADD fails without ever subsequently receiving the TaskBarCreated message. It's not a real problem handling this issue; I will add a retry mechanism that attempts NIM_ADD until the call finally succeeds (I hope/expect this to work). However, I'm still wondering why the TaskBarCreated message solution isn't also able to fix the failed startup icon creation ? FYI. I used the same code as in the MSDN article you suggested (i.e. call RegisterMessage() during WM_CREATE). Kris
Technical Details
Message-ID:
<47bf5bd8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47B85E8F.6040508@ks.com> <47bb1415$1@newsgroups.borland.com> <47bc8219$1@newsgroups.borland.com> <47bc8d05@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fd4854ec85a82474 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Sat, 23 Feb 2008 00:33:56 +0100 From: Kris <ks@ks.com> User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Multiple Shell_NotifyIcon calls References: <47B85E8F.6040508@ks.com> <47bb1415$1@newsgroups.borland.com> <47bc8219$1@newsgroups.borland.com> <47bc8d05@newsgroups.borland.com> In-Reply-To: <47bc8d05@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.101.2.208 Message-ID: <47bf5bd8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1203723224 83.101.2.208 (22 Feb 2008 15:33:44 -0700) Lines: 32 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail