🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Resource files???

#5628
From: Jeff
Date: Fri, 05 Aug 2005 16:34
30 lines
1852 bytes
I'm have a heck of a time trying to get a tray icon to change during 
runtime. I've added a second icon to my resource file, using Borland's Image 
Editor, but the image doesn't appear to be in the exe? I use the LoadIcon() 
function to load it during runtime; see code below.

void __fastcall TfrmMain::UpdateIcon(const char *ptr_chrHint, bool 
boolDisIcon)
{
    NOTIFYICONDATA IconData;

    if (boolDisIcon)    //Disabled icon desired
        IconData.hIcon = LoadIcon(HInstance, "DISABLEDICON");
    else
        IconData.hIcon = LoadIcon(HInstance, "MAINICON");

    IconData.cbSize = sizeof(NOTIFYICONDATA);
    IconData.uID    = IDC_TRAY1;
    IconData.hWnd   = Handle;
    IconData.uFlags = NIF_MESSAGE | NIF_TIP;
    IconData.uCallbackMessage = WM_TRAYNOTIFY;
    lstrcpy(IconData.szTip, ptr_chrHint);

    Shell_NotifyIcon(NIM_MODIFY,&IconData);
}

The .res file has been added to the project, and the MAINICON is in there, 
but what am I missing?

Thanks,
Jeff 
Technical Details
Message-ID: <42f39510@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.wiretrip.org!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e43ccfa66ff1058d,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jeff" <Jeff@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Resource files???
Date: Fri, 5 Aug 2005 10:34:37 -0600
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
NNTP-Posting-Host: 198.68.195.169
Message-ID: <42f39510@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1123259664 198.68.195.169 (5 Aug 2005 09:34:24 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.wiretrip.org!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail