Article View: borland.public.cppbuilder.nativeapi
Article #690Re: Multiple Shell_NotifyIcon calls
From: Kris
Date: Sat, 23 Feb 2008 21:36
Date: Sat, 23 Feb 2008 21:36
28 lines
2417 bytes
2417 bytes
Asger Joergensen wrote: > Create Your icon in the application OnIdle event that way Your > app will be fully created before You create Your Icon. > OnIdle is called more then once so You need to set a flag when > Your icon is created or if You dont use OnIdle for anything else > You can set Application->OnIdle = 0; when You are done. Hi, Yes. Doing it in OnIdle is probably preferable. However, some tests showed that the NIM_ADD failure is not elimated. But that's no problem anymore. OnIdle now keeps on retrying NIM_ADD until it finally succeeds (even though my app isn't doing a lot of work it takes about 5 seconds before the OnIdle gets triggered a 2nd time and manages to execute NIM_ADD successfully, but I guess this long delay is caused by Windows which was still busy booting?). [23-feb-2008.22:21:44] NIM_ADD execution at TickCount 32703... [23-feb-2008.22:21:48] ERROR: Shell_NotifyIcon NIM_ADD failed. [23-feb-2008.22:21:50] NIM_ADD execution at TickCount 38609... So, everything seems to be under control now. No sure why the failure is occurring in the first place, but the retry is working as expected. Thanks for your feedback, Kris
Technical Details
Message-ID:
<47c091d9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!newsfeed.freenet.de!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> <47bf5bd8$1@newsgroups.borland.com> <47bf6cce$1@newsgroups.borland.com> <47c02cfe$1@newsgroups.borland.com> <MPG.222a69221f6aefd5989a7d@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 22:36:39 +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> <47bf5bd8$1@newsgroups.borland.com> <47bf6cce$1@newsgroups.borland.com> <47c02cfe$1@newsgroups.borland.com> <MPG.222a69221f6aefd5989a7d@newsgroups.borland.com> In-Reply-To: <MPG.222a69221f6aefd5989a7d@newsgroups.borland.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.101.2.106 Message-ID: <47c091d9$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1203802585 83.101.2.106 (23 Feb 2008 13:36:25 -0700) Lines: 28 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail