+ // we don't have the menu id here, so we use the id to specify if the event
+ // was from a popup menu or a normal one
+ wxMenuEvent event(evtType, isPopup ? -1 : 0);
+ event.SetEventObject(this);
+
+ return GetEventHandler()->ProcessEvent(event);
+}
+
+// ---------------------------------------------------------------------------
+// the window proc for wxFrame
+// ---------------------------------------------------------------------------
+
+long wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
+{
+ long rc = 0;
+ bool processed = FALSE;
+
+ switch ( message )
+ {
+ case WM_CLOSE:
+ // if we can't close, tell the system that we processed the
+ // message - otherwise it would close us
+ processed = !Close();
+ break;
+
+ case WM_SIZE:
+ processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
+ break;
+
+ case WM_COMMAND:
+ {
+ WORD id, cmd;
+ WXHWND hwnd;
+ UnpackCommand((WXWPARAM)wParam, (WXLPARAM)lParam,
+ &id, &hwnd, &cmd);
+
+ processed = HandleCommand(id, cmd, (WXHWND)hwnd);
+ }
+ break;
+
+ case WM_PAINT:
+ processed = HandlePaint();
+ break;
+
+#ifndef __WXMICROWIN__
+ case WM_MENUSELECT:
+ {
+ WXWORD item, flags;
+ WXHMENU hmenu;
+ UnpackMenuSelect(wParam, lParam, &item, &flags, &hmenu);
+
+ processed = HandleMenuSelect(item, flags, hmenu);
+ }
+ break;
+
+#ifndef __WIN16__
+ case WM_ENTERMENULOOP:
+ processed = HandleMenuLoop(wxEVT_MENU_OPEN, wParam);
+ break;
+
+ case WM_EXITMENULOOP:
+ processed = HandleMenuLoop(wxEVT_MENU_CLOSE, wParam);
+ break;
+#endif // __WIN16__
+
+ case WM_QUERYDRAGICON:
+ {
+ HICON hIcon = m_icon.Ok() ? GetHiconOf(m_icon)
+ : (HICON)GetDefaultIcon();
+ rc = (long)hIcon;
+ processed = rc != 0;
+ }
+ break;
+#endif // !__WXMICROWIN__