don't statically link to SetMenuInfo(): it is not present in Win95/NT4
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c95499b9be
commit
9f7e1cff95
@ -62,6 +62,10 @@
|
|||||||
// other standard headers
|
// other standard headers
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#if wxUSE_OWNER_DRAWN && defined(MIIM_BITMAP)
|
||||||
|
#include "wx/dynlib.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef MNS_CHECKORBMP
|
#ifndef MNS_CHECKORBMP
|
||||||
#define MNS_CHECKORBMP 0x04000000
|
#define MNS_CHECKORBMP 0x04000000
|
||||||
#endif
|
#endif
|
||||||
@ -435,10 +439,19 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
|||||||
// case in wx API
|
// case in wx API
|
||||||
WinStruct<MENUINFO> mi;
|
WinStruct<MENUINFO> mi;
|
||||||
|
|
||||||
mi.fMask = MIM_STYLE;
|
// don't call SetMenuInfo() directly, this would prevent
|
||||||
mi.dwStyle = MNS_CHECKORBMP;
|
// the app from starting up under Windows 95/NT 4
|
||||||
if ( !::SetMenuInfo(GetHmenu(), &mi) )
|
typedef BOOL (WINAPI *SetMenuInfo_t)(HMENU, MENUINFO *);
|
||||||
wxLogLastError(_T("SetMenuInfo(MNS_NOCHECK)"));
|
|
||||||
|
wxDynamicLibrary dllUser(_T("user32"));
|
||||||
|
wxDYNLIB_FUNCTION(SetMenuInfo_t, SetMenuInfo, dllUser);
|
||||||
|
if ( pfnSetMenuInfo )
|
||||||
|
{
|
||||||
|
mi.fMask = MIM_STYLE;
|
||||||
|
mi.dwStyle = MNS_CHECKORBMP;
|
||||||
|
if ( !(*pfnSetMenuInfo)(GetHmenu(), &mi) )
|
||||||
|
wxLogLastError(_T("SetMenuInfo(MNS_NOCHECK)"));
|
||||||
|
}
|
||||||
|
|
||||||
// tell the item that it's not really owner-drawn but only
|
// tell the item that it's not really owner-drawn but only
|
||||||
// needs to draw its bitmap, the rest is done by Windows
|
// needs to draw its bitmap, the rest is done by Windows
|
||||||
|
Loading…
Reference in New Issue
Block a user