Hello, I compiled my trayicon utility c++ code in visual studio 2005 express edition and tray icon balloons showed up successfully but later I deleted my firewall, switched on to windows firewall and now I am on another firewall software. Now i ran my same project and balloons showed up successfully but when i rebuilt it, i can't see balloons anymore. My Shell_NotifyIcon method still returns true.

Here is the code:

nid.cbSize = sizeof( NOTIFYICONDATA_V2_SIZE ); // i've tested NOTIFYICONDATA //and nid as well

nid.hWnd = hWnd;
nid.uID = uID; 
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP|NIF_INFO; nid.dwInfoFlags = 0x00000004; 
strcpy(nid.szInfoTitle , balloonTitle); 
strcpy(nid.szInfo , balloonMsg); 
int ret = Shell_NotifyIcon( NIM_MODIFY, &nid );

Can anybody suggest where does the problem lie? it seems it is related to OS, my OS is XP and i've even modified "EnableBalloonTips" to 1.

Faran Shabbir

Read the following Link Carefully and check for MACRO & GUID that needs to be defined in case of XP, I am assuming that you are good in understanding msdn doc. If you still find it difficult to implement I will provide you the sample.

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

Hope the above link helps.

Read the following Link Carefully and check for MACRO & GUID that needs to be defined in case of XP, I am assuming that you are good in understanding msdn doc. If you still find it difficult to implement I will provide you the sample.

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

Hope the above link helps.

Thanks much... it has been helpful.

The problem was here:

nid.cbSize = sizeof( NOTIFYICONDATA_V2_SIZE );

it should be:

nid.cbSize = NOTIFYICONDATA_V2_SIZE;

It is used for Windows 2000 or later versions. The prior one was returning wrong value (as expected) :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.