Remove dynamic loading of SetMenuInfo.

SetMenuInfo is available since Win2k
This commit is contained in:
Tobias Taschner 2015-09-16 18:35:38 +02:00
parent 27ffe525b5
commit 79d485d7a9

View File

@ -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<MENUINFO> 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)"));
}
}
}