🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Assigning Icon from ExtractIconEx without leaks

#190
From: Remy Lebeau (TeamB)
Date: Wed, 02 Jul 2008 00:34
19 lines
1819 bytes
"Mike Collins" <its@TheBottomOfThePost> wrote in message 
news:486ab7ec@newsgroups.borland.com...

> After I've loaded the required icon, and sent the Shell_NotifyIcon()
> notification, i delete the loaded icon using DestroyIcon().  based on
> what you have just explained, could this possibly be the cause of
> my problem?

I doubt it, since Shell_NotifyIcon() makes a copy of the specified HICON, 
which the system then takes ownership of, leaving your original HICON 
untouched.

What I usually do, however, is store my system tray HICON in a TIcon that 
stays alive for the lifetime of the tray icon.  When I want to display a new 
HICON, I update the TIcon before then issuing the NIM_MODIFY request.


Gambit 
Technical Details
Message-ID: <486acd4a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <486a1911@newsgroups.borland.com> <486a5c9e$1@newsgroups.borland.com> <486aa96e@newsgroups.borland.com> <486aaff6$1@newsgroups.borland.com> <486ab7ec@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,dea519f40adb32bd
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <486a1911@newsgroups.borland.com> <486a5c9e$1@newsgroups.borland.com> <486aa96e@newsgroups.borland.com> <486aaff6$1@newsgroups.borland.com> <486ab7ec@newsgroups.borland.com>
Subject: Re: Assigning Icon from ExtractIconEx without leaks
Date: Tue, 1 Jul 2008 17:34:04 -0700
Lines: 21
Organization: Lebeau Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 207.178.157.90
Message-ID: <486acd4a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1214958922 207.178.157.90 (1 Jul 2008 17:35:22 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail