From 93d5b8bb0d978f69925e9431c82b73d9ad9fbace Mon Sep 17 00:00:00 2001 From: Bryan Petty Date: Wed, 10 Sep 2014 14:49:20 +0000 Subject: [PATCH] Register message "TaskbarButtonCreated" when wxTopLevelWindowMSW is created. This message is used to make sure the taskbar button is in place, so wxTaskbarButton object can initialize correctly. Author: Chaobin Zhang git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/toplevel.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 028660b1f6..1305aad088 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -63,6 +63,18 @@ #define ICON_SMALL 0 #endif +// ---------------------------------------------------------------------------- +// globals +// ---------------------------------------------------------------------------- + +#if wxUSE_MENUS || wxUSE_MENUS_NATIVE + extern wxMenu *wxCurrentPopupMenu; +#endif // wxUSE_MENUS || wxUSE_MENUS_NATIVE + +#if wxUSE_TASKBARBUTTON +static WXUINT gs_msgTaskbarButtonCreated = 0; +#endif + // ---------------------------------------------------------------------------- // stubs for missing functions under MicroWindows // ---------------------------------------------------------------------------- @@ -415,6 +427,12 @@ WXLRESULT wxTopLevelWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WX } break; } +#if wxUSE_TASKBARBUTTON + if ( message == gs_msgTaskbarButtonCreated ) + { + processed = true; + } +#endif if ( !processed ) rc = wxTopLevelWindowBase::MSWWindowProc(message, wParam, lParam); @@ -631,6 +649,10 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent, #if defined(__SMARTPHONE__) && defined(__WXWINCE__) SetRightMenu(); // to nothing for initialization #endif +#if wxUSE_TASKBARBUTTON + gs_msgTaskbarButtonCreated = + ::RegisterWindowMessage(wxT("TaskbarButtonCreated")); +#endif return ret; }