🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools.mfc
Article #145

Re: How to Kill a Tray icon from an another application ?

#145
From: SNOW CRASH
Date: Fri, 17 Nov 2000 00:00
44 lines
2943 bytes
On Fri, 17 Nov 2000 19:27:03 +0000, Bob Moore
<bob@mooremvp.freeserve.co.uk> wrote:

>On Fri, 17 Nov 2000 15:25:15 GMT, SNOW CRASH wrote:
>
>>Just a guess, but try and (instead) do an 
>>InvalidateRect(hwndTrayWnd, NULL);
>
>I also came upon this problem some time ago. I tried Invalidating, and
>that doesn't work. I've tried enumerating the children of the tray and
>repainting them, and that doesn't work either. I suspect (unless
>someone else knows better) that Ians suggestion of inserting and
>removing a dummy icon may the only surefire way of doing this.
>
>--
>Bob Moore [WinSDK MVP]
>http://www.mooremvp.freeserve.co.uk/
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Posted via news://msnews.microsoft.com
>Do not reply via email unless specifically requested to do so.
>Unsolicited email is NOT welcome and will go unanswered.
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Actually, now that I think about it, invalidating the window won't do
anything; it already have the ICON handle itself so it will just
repaint it.

The act of moving the mouse over the icon causes notification messages
to be sent to the owner of the icon (I believe, but if not at least
the tray does _something_).  What is probably happening is that it
gets the "owner" of the tray icon and does a "IsWindow(hWnd)" check on
the handle -- If that comes back as FALSE, then it just kills the
icon.  

Question is, is there a way to get the tray to do this check.. Perhaps
some sort of update message (WM_PAINT is a good try but obviously
doesn't do the trick.)

Unfortunately, I don't have a solution, but I would be interested to
see any results.  If I have time this weekend I will try sending
various messages to the tray and see if any work.

// CHRIS
Technical Details
Message-ID: <3a159a41.1310388038@news.dsl.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <FU8R5.763$%o6.2878648@nnrp3.proxad.net> <8v38h0$2bgf$1@nnrp01.ops.uunet.co.za> <3a154d9c.1290767305@news.dsl.net> <v91b1t8217o1bufq8ggi5vpsjrl9dlbiik@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1138df,d00bad325b1977a5
X-Google-Attributes: gid1138df,public
X-Google-Thread: 1053e6,d00bad325b1977a5
X-Google-Attributes: gid1053e6,public
X-Google-Thread: 113dfb,d00bad325b1977a5
X-Google-Attributes: gid113dfb,public
X-Google-Thread: f5082,d00bad325b1977a5
X-Google-Attributes: gidf5082,public
X-Google-Thread: 104d65,d00bad325b1977a5
X-Google-Attributes: gid104d65,public
From: win32mfc@yahoo.com (SNOW CRASH)
Subject: Re: How to Kill a Tray icon from an another application  ?
Date: 2000/11/17
Message-ID: <3a159a41.1310388038@news.dsl.net>
X-Deja-AN: 694878726
References: <FU8R5.763$%o6.2878648@nnrp3.proxad.net> <8v38h0$2bgf$1@nnrp01.ops.uunet.co.za> <3a154d9c.1290767305@news.dsl.net> <v91b1t8217o1bufq8ggi5vpsjrl9dlbiik@4ax.com>
Organization: Posted via Supernews, http://www.supernews.com
Reply-To: win32mfc@yahoo.com
Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.programmer.win32,fr.comp.os.ms-windows.programmation,microsoft.public.fr.vc,microsoft.public.vc.mfc
X-Complaints-To: newsabuse@supernews.com