+class wxMSWSystemMenuFontModule : public wxModule
+{
+public:
+
+ virtual bool OnInit()
+ {
+ ms_systemMenuFont = new wxFont;
+
+#if defined(__WXMSW__) && defined(__WIN32__) && defined(SM_CXMENUCHECK)
+ NONCLIENTMETRICS nm;
+ nm.cbSize = sizeof(NONCLIENTMETRICS);
+ SystemParametersInfo(SPI_GETNONCLIENTMETRICS,0,&nm,0);
+
+ ms_systemMenuButtonWidth = nm.iMenuHeight;
+ ms_systemMenuHeight = nm.iMenuHeight;
+
+ // create menu font
+ wxNativeFontInfo info;
+ memcpy(&info.lf, &nm.lfMenuFont, sizeof(LOGFONT));
+ ms_systemMenuFont->Create(info);
+#endif
+
+ return true;
+ }
+
+ virtual void OnExit()
+ {
+ delete ms_systemMenuFont;
+ ms_systemMenuFont = NULL;
+ }
+
+ static wxFont* ms_systemMenuFont;
+ static int ms_systemMenuButtonWidth; // windows clean install default
+ static int ms_systemMenuHeight; // windows clean install default
+private:
+ DECLARE_DYNAMIC_CLASS(wxMSWSystemMenuFontModule)
+};
+
+// these static variables are by the wxMSWSystemMenuFontModule object
+// and reflect the system settings returned by the Win32 API's
+// SystemParametersInfo() call.
+
+wxFont* wxMSWSystemMenuFontModule::ms_systemMenuFont = NULL;
+int wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth = 18; // windows clean install default
+int wxMSWSystemMenuFontModule::ms_systemMenuHeight = 18; // windows clean install default
+
+IMPLEMENT_DYNAMIC_CLASS(wxMSWSystemMenuFontModule, wxModule)