X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a71d815bbe669ebb9bdb9409926a272c37a5a9aa..032bc940fcde34cc649eaa111cd6aff1cda66104:/src/msw/taskbar.cpp?ds=sidebyside diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index c5b9b9b5c1..503480beae 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -14,15 +14,14 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP -#include "wx/defs.h" -#include "wx/window.h" -#include "wx/frame.h" -#include "wx/utils.h" -#include "wx/menu.h" + #include "wx/window.h" + #include "wx/frame.h" + #include "wx/utils.h" + #include "wx/menu.h" #endif #include "wx/msw/private.h" @@ -148,7 +147,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) m_icon = icon; m_strTooltip = tooltip; - NotifyIconData notifyData((HWND)m_win->GetHWND()); + NotifyIconData notifyData(GetHwndOf(m_win)); if (icon.Ok()) { @@ -179,7 +178,7 @@ bool wxTaskBarIcon::RemoveIcon() m_iconAdded = false; - NotifyIconData notifyData((HWND)m_win->GetHWND()); + NotifyIconData notifyData(GetHwndOf(m_win)); return Shell_NotifyIcon(NIM_DELETE, ¬ifyData) != 0; } @@ -204,13 +203,14 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) menu->UpdateUI(); - // Work around a WIN32 bug - ::SetForegroundWindow((HWND)m_win->GetHWND()); + // the SetForegroundWindow() and PostMessage() calls are needed to work + // around Win32 bug with the popup menus shown for the notifications as + // documented at http://support.microsoft.com/kb/q135788/ + ::SetForegroundWindow(GetHwndOf(m_win)); bool rval = m_win->PopupMenu(menu, 0, 0); - // Work around a WIN32 bug - ::PostMessage((HWND)m_win->GetHWND(), WM_NULL, 0, 0L); + ::PostMessage(GetHwndOf(m_win), WM_NULL, 0, 0L); m_win->PopEventHandler(false);