From 79d485d7a9240787f77ff709ab2340974fd739ae Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Wed, 16 Sep 2015 18:35:38 +0200 Subject: [PATCH] Remove dynamic loading of SetMenuInfo. SetMenuInfo is available since Win2k --- src/msw/menu.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 3ab2343f1a..86dd6df83c 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -580,21 +580,11 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // boxes are used together with bitmaps and this is not the // case in wx API WinStruct mi; - - // don't call SetMenuInfo() directly, this would prevent - // the app from starting up under Windows 95/NT 4 - typedef BOOL (WINAPI *SetMenuInfo_t)(HMENU, MENUINFO *); - - wxDynamicLibrary dllUser(wxT("user32")); - wxDYNLIB_FUNCTION(SetMenuInfo_t, SetMenuInfo, dllUser); - if ( pfnSetMenuInfo ) + mi.fMask = MIM_STYLE; + mi.dwStyle = MNS_CHECKORBMP; + if ( !::SetMenuInfo(GetHmenu(), &mi) ) { - mi.fMask = MIM_STYLE; - mi.dwStyle = MNS_CHECKORBMP; - if ( !(*pfnSetMenuInfo)(GetHmenu(), &mi) ) - { - wxLogLastError(wxT("SetMenuInfo(MNS_NOCHECK)")); - } + wxLogLastError(wxT("SetMenuInfo(MNS_NOCHECK)")); } } }