]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/menu.cpp
[ 1509599 ] 'Split pickers page in widgets sample' with more icons and rebaking.
[wxWidgets.git] / src / msw / menu.cpp
index 738d07c711f7e44bf102651b8fab8f03ae79e8b8..cdec3e7a1c61fd6e68757071693e2a25215e3b38 100644 (file)
 
 #if wxUSE_MENUS
 
+#include "wx/menu.h"
+
 #ifndef WX_PRECOMP
     #include "wx/frame.h"
-    #include "wx/menu.h"
     #include "wx/utils.h"
     #include "wx/intl.h"
     #include "wx/log.h"
 
 #include "wx/msw/private.h"
 
+// include <commctrl.h> "properly"
+#include "wx/msw/wrapcctl.h"
+
 #ifdef __WXWINCE__
 #include <windows.h>
 #include <windowsx.h>
 #include <tchar.h>
 #include <ole2.h>
 #include <shellapi.h>
-#include <commctrl.h>
 #if (_WIN32_WCE < 400) && !defined(__HANDHELDPC__)
 #include <aygshell.h>
 #endif
@@ -874,7 +877,9 @@ WXHMENU wxMenuBar::Create()
 
     HWND hCommandBar = (HWND) GetToolBar()->GetHWND();
     HMENU hMenu = (HMENU)::SendMessage(hCommandBar, SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0);
-    if (hMenu)
+
+    // hMenu may be zero on Windows Mobile 5. So add the menus anyway.
+    if (1) // (hMenu)
     {
         TBBUTTON tbButton;
         memset(&tbButton, 0, sizeof(TBBUTTON));
@@ -1133,6 +1138,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
             wxLogLastError(wxT("TB_INSERTBUTTON"));
             return false;
         }
+        wxUnusedVar(mswpos);
 #else
         if ( !::InsertMenu(GetHmenu(), mswpos,
                            MF_BYPOSITION | MF_POPUP | MF_STRING,