+ bool ok = wxShellNotifyIcon(m_iconAdded ? NIM_MODIFY
+ : NIM_ADD, ¬ifyData) != 0;
+
+ if ( !ok )
+ {
+ wxLogLastError(wxT("wxShellNotifyIcon(NIM_MODIFY/ADD)"));
+ }
+
+ if ( !m_iconAdded && ok )
+ m_iconAdded = true;
+
+ return ok;
+}
+
+#if wxUSE_TASKBARICON_BALLOONS
+
+bool
+wxTaskBarIcon::ShowBalloon(const wxString& title,
+ const wxString& text,
+ unsigned msec,
+ int flags)
+{
+ wxCHECK_MSG( m_iconAdded, false,
+ wxT("can't be used before the icon is created") );
+
+ const HWND hwnd = GetHwndOf(m_win);
+
+ // we need to enable version 5.0 behaviour to receive notifications about
+ // the balloon disappearance
+ NotifyIconData notifyData(hwnd);
+ notifyData.uFlags = 0;
+ notifyData.uVersion = 3 /* NOTIFYICON_VERSION for Windows XP */;
+
+ if ( !wxShellNotifyIcon(NIM_SETVERSION, ¬ifyData) )
+ {
+ wxLogLastError(wxT("wxShellNotifyIcon(NIM_SETVERSION)"));
+ }