diff --git a/docs/changes.txt b/docs/changes.txt index 7145774cae..1035ac295d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -153,6 +153,7 @@ wxMSW: - added wxTextCtrl::HitTest() - experimental wxURL implementation using WinInet functions (Hajo Kirchhoff) - fixed several bugs in wxNotebook with wxNB_MULTILINE style +- accelerators are now initially hidden if appropriate (Peter Nielsen) wxGTK: diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 2376e815e6..47bc5ff54a 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -41,6 +41,7 @@ #include "wx/module.h" #include "wx/msw/private.h" +#include "wx/msw/missing.h" #if defined(__WXWINCE__) #include @@ -514,6 +515,23 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent, EnableCloseButton(false); } + // for some reason we need to manually send ourselves this message as + // otherwise the mnemonics are always shown -- even if they're configured + // to be hidden until "Alt" is pressed in the control panel + // + // this could indicate a bug somewhere else but for now this is the only + // fix we have + if ( ret ) + { + SendMessage + ( + GetHwnd(), + WM_UPDATEUISTATE, + MAKEWPARAM(UIS_INITIALIZE, UISF_HIDEFOCUS | UISF_HIDEACCEL), + 0 + ); + } + return ret; }