I have some code that pops up a balloon tip. It works on Vista but not on Windows XP. This is the code so far. It works on Vista but not on XP. I can’t understand why. This version does not load the icon so it will show up blank.
memset(&m_notifyData, 0, sizeof(NOTIFYICONDATA)); m_notifyData.cbSize = sizeof(NOTIFYICONDATA); m_notifyData.uFlags = NIF_INFO | NIF_MESSAGE; m_notifyData.hWnd = (HWND) m_preference_window->GetHWND(); m_notifyData.uID = 99; m_notifyData.uTimeout = timeout; m_notifyData.dwInfoFlags = NIIF_NOSOUND | NIIF_INFO; wxStrncpy(m_notifyData.szInfo, message.c_str(), WXSIZEOF(m_notifyData.szInfo)); wxStrncpy(m_notifyData.szInfoTitle, title.c_str(),WXSIZEOF(m_notifyData.szInfoTitle)); Shell_NotifyIcon(NIM_ADD, &m_notifyData); wxLogMessage('Balloon timeout is %i', timeout); m_timer_balloon->Start(timeout, true);
when the time runs, this gets executed:
Shell_NotifyIcon(NIM_DELETE, &m_notifyData);
Any ideas why XP doesn’t show the message?
Should be
Vista added several members on top of what XP provided. Size is used to indicate what version of the struct you are passing. XP is rejecting it, since the size is unrecognized.