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?
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