+ memset(this, 0, sizeof(NOTIFYICONDATA));
+ cbSize = sizeof(NOTIFYICONDATA);
+ hWnd = (HWND) hwnd;
+ uCallbackMessage = gs_msgTaskbar;
+ uFlags = NIF_MESSAGE;
+
+ // we use the same id for all taskbar icons as we don't need it to
+ // distinguish between them
+ uID = 99;
+ }
+};
+
+// ----------------------------------------------------------------------------
+// wxTaskBarIcon
+// ----------------------------------------------------------------------------
+
+wxTaskBarIcon::wxTaskBarIcon()
+{
+ m_win = NULL;
+ m_iconAdded = false;
+ RegisterWindowMessages();
+}
+
+wxTaskBarIcon::~wxTaskBarIcon()
+{
+ if ( m_iconAdded )
+ RemoveIcon();
+
+ if ( m_win )
+ {
+ // we must use delete and not Destroy() here because the latter will
+ // only schedule the window to be deleted during the next idle event
+ // processing but we may not get any idle events if there are no other
+ // windows left in the program
+ delete m_win;