NO

Author Topic: System Tray Ballon ToolTip  (Read 2637 times)

student12

  • Guest
System Tray Ballon ToolTip
« on: April 26, 2008, 09:01:59 AM »
hi

I'm new to programming and pelles c .. and I'm having difficulties adding a Ballon Message in my System Tray .. i use the following code

Code: [Select]
NOTIFYICONDATA ntc;
ZeroMemory( &(ntc),sizeof(ntc));

ntc.cbSize = sizeof(ntc);
ntc.hWnd = hwndDlg;
ntc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDR_ICO_MAIN));

ntc.uFlags = NIF_INFO  | NIF_ICON | NIF_TIP;
ntc.dwInfoFlags = NIIF_INFO;
ntc.uTimeout = 10000;
lstrcpy(ntc.szInfo, "Application is now Downloading information");
lstrcpy(ntc.szInfoTitle, "Downloading...");
lstrcpy(ntc.szTip, "Informatics");

Shell_NotifyIcon(NIM_ADD , &ntc);

it doesn't give an error but the Ballon ToolTip doesn't show either. Can someone help me, and tell me what im doing wrong?

Moonglow

  • Guest
Re: System Tray Ballon ToolTip
« Reply #1 on: April 01, 2009, 11:55:31 PM »
You need to add this define on top line before any include's....

#define _WIN32_IE 0x0600


And change this :
ntc.cbSize = sizeof(ntc);

To this:
ntc.cbSize                     = NOTIFYICONDATA_V2_SIZE;


Tested on Windows XP, Vista