🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages Started by Mike Collins Fri, 29 Feb 2008 11:06
custom icons / images in system tray balloon tips
#576
Author: Mike Collins
Date: Fri, 29 Feb 2008 11:06
12 lines
1344 bytes
Hi all, got a quickie,

I've got a system tray *application* which displays balloon tips in response 
to certain events.  I've no problem with this aspect but now I want to 
display my own x16 icon in the actual balloon tip.  The Windows XP network 
connection app does this but I can't seem to find the right information.

P.S. I'm intending on running this on Windows XP.

Many thanks in advance,

Mike C 
Re: custom icons / images in system tray balloon tips
#579
Author: Bob Gonder
Date: Fri, 29 Feb 2008 17:18
9 lines
1434 bytes
Mike Collins wrote:

>I've got a system tray *application* which displays balloon tips in response 
>to certain events.  I've no problem with this aspect but now I want to 
>display my own x16 icon in the actual balloon tip.

There is this .net feature:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.notifyicon.balloontipicon(VS.80).aspx
http://tinyurl.com/3dwdll
Re: custom icons / images in system tray balloon tips
#581
Author: Remy Lebeau (TeamB)
Date: Fri, 29 Feb 2008 18:46
22 lines
1823 bytes
"Mike Collins" <its@TheBottomOfThePost> wrote in message 
news:47c7e508@newsgroups.borland.com...

> I've got a system tray *application* which displays balloon tips in
> response to certain events.  I've no problem with this aspect but
> now I want to display my own x16 icon in the actual balloon tip.

Did you read the documentation for NOTIFYICONDATA yet?  It tells you exactly 
how to do that:

    NOTIFYICONDATA Structure
    http://msdn2.microsoft.com/en-us/library/bb773352(VS.85).aspx

In a nutshell, on XP SP2 and later, you can set the uFlags member to 
NIF_INFO to enable a balloon tooltip, set the dwInfoFlags member to 
NIIF_USER to specify a custom icon, and then put your custom icon into the 
hIcon member.  On Vista and later, there is a new hBalloonIcon member that 
you can use instead of the hIcon member.


Gambit 
Re: custom icons / images in system tray balloon tips
#588
Author: Mike Collins
Date: Sat, 01 Mar 2008 12:49
33 lines
2281 bytes
Thanks for the reply - weird results though.  I've implimentated what has 
been suggested but whist i get the balloon icon changed, it does not 
corrispond to the icon that i specify.  My code below should display the 
applciations default icon but actually, i get the wi-fi connection icon 
being displayed - which has nothing to do with my application.  My code 
looks like this

         nid.uFlags      = NIF_INFO;       // tried with and without this...
         nid.dwInfoFlags = NIIF_USER;  // couldn't find a def for this so 
defined it as 4
         HICON hIcon = (HICON)::LoadImage(HInstance, MAKEINTRESOURCE(101), 
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
         nid.hIcon  = hIcon;
         bRtn = (bool)Shell_NotifyIcon(NIM_MODIFY, &nid);
         ::DestroyIcon(hIcon);

Any ideas?

Thanks again,

Mike


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:47c852f5$3@newsgroups.borland.com...
>
> "Mike Collins" <its@TheBottomOfThePost> wrote in message 
> news:47c7e508@newsgroups.borland.com...
>
>> I've got a system tray *application* which displays balloon tips in
>> response to certain events.  I've no problem with this aspect but
>> now I want to display my own x16 icon in the actual balloon tip.
>
Re: custom icons / images in system tray balloon tips
#591
Author: Mike Collins
Date: Sat, 01 Mar 2008 22:31
16 lines
1503 bytes
Please ignore last post - got it working in the end.

The documentation is not as clear as it should be.  If you specify NIIF_USER 
for the Info Flag, you must also specify NIF_INFO *AND* NIF_ICON for the 
standard flags i.e.

nid.uFlags      = NIF_INFO | NIF_ICON;
nid.dwInfoFlags = NIIF_USER;
 HICON hIcon = (HICON)::LoadImage(HInstance, MAKEINTRESOURCE(101), 
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
nid.hIcon  = hIcon;
bRtn = (bool)Shell_NotifyIcon(NIM_MODIFY, &nid);
::DestroyIcon(hIcon);


Mike 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads