+// handle WM_INITMENUPOPUP message
+bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu)
+{
+ wxMenu* menu = NULL;
+ if (GetMenuBar())
+ {
+ int nCount = GetMenuBar()->GetMenuCount();
+ for (int n = 0; n < nCount; n++)
+ {
+ if (GetMenuBar()->GetMenu(n)->GetHMenu() == hMenu)
+ {
+ menu = GetMenuBar()->GetMenu(n);
+ break;
+ }
+ }
+ }
+
+ wxMenuEvent event(wxEVT_MENU_OPEN, 0, menu);
+ event.SetEventObject(this);
+
+ return GetEventHandler()->ProcessEvent(event);
+}
+
+#ifdef __WXWINCE__
+WXHWND wxFrame::CreateCommandBar()
+{
+ if (m_commandBar)
+ return m_commandBar;
+
+ m_commandBar = (WXHWND) CommandBar_Create(wxGetInstance(), GetHwnd(), NewControlId());
+ if (!m_commandBar)
+ {
+ wxFAIL_MSG( _T("failed to create commandbar") );
+ return 0;
+ }
+ return m_commandBar;
+}
+
+void wxFrame::RemoveCommandBar()
+{
+ if (m_commandBar)
+ {
+ ::DestroyWindow((HWND) m_commandBar);
+ m_commandBar = NULL;
+ }
+}
+#endif
+
+