error creating balloon tip for tray icon
Hi all,
I'm having a problem in creating a balloon tip for tray icon.
I found a code from "msdn" , which is
#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
NOTIFYICONDATA IconData = {0};
IconData.cbSize = SIZEOF(IconData);
IconData.hWnd = hwndNI;
IconData.uFlags = NIF_INFO;
HRESULT hr = StringCchCopy(IconData.szInfo, ARRAYSIZE(IconData.szInfo), TEXT("Your message text goes here."));
if(FAILED(hr))
{
// TODO: Write an error handler in case the call to StringCchCopy fails.
}
IconData.uTimeout = 15000; // in milliseconds
Shell_NotifyIcon(NIM_MODIFY, &IconData);
but here in my application i.e. in win32, i'm not having either the NIF_INFO, nor IconData.szInfo, similarly timeout.
So please reply me what should I do to implement it.
Regards,
Gaurav
Re: error creating balloon tip for tray icon
Please add "#define _WIN32_IE 0x0500" in your header file
Re: error creating balloon tip for tray icon
Yes, as Wang suggested, you need to define your version BEFORE you include windows.h. Also, depending on what version of VC++ you're using, you may need to download the Platform SDK from Microsoft's website.
msdn.microsoft.com/platformsdk/