System Tray Ballon ToolTip

Started by student12, April 26, 2008, 09:01:59 AM

Previous topic - Next topic

student12

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

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

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