+ 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);
+
+ HandleCommand(id, cmd, (WXHWND)hwnd);
+
+ // don't pass WM_COMMAND to the base class whether we processed
+ // it or not because we did generate an event for it (our
+ // HandleCommand() calls the base class version) and we must
+ // not do it again or the handlers which skip the event would
+ // be called twice
+ processed = true;
+ }
+ break;
+
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+#if wxUSE_MENUS
+ case WM_INITMENUPOPUP:
+ processed = HandleMenuPopup(wxEVT_MENU_OPEN, (WXHMENU)wParam);
+ break;
+
+ case WM_MENUSELECT:
+ {
+ WXWORD item, flags;
+ WXHMENU hmenu;
+ UnpackMenuSelect(wParam, lParam, &item, &flags, &hmenu);
+
+ processed = HandleMenuSelect(item, flags, hmenu);
+ }
+ break;
+
+ case WM_EXITMENULOOP:
+ // Under Windows 98 and 2000 and later we're going to get
+ // WM_UNINITMENUPOPUP which will be used to generate this event
+ // with more information (notably the menu that was closed) so we
+ // only need this one under old Windows systems where the newer
+ // event is never sent.
+ if ( wxGetWinVersion() < wxWinVersion_98 )
+ processed = HandleExitMenuLoop(wParam);
+ break;
+
+ case WM_UNINITMENUPOPUP:
+ processed = HandleMenuPopup(wxEVT_MENU_CLOSE, (WXHMENU)wParam);
+ break;
+#endif // wxUSE_MENUS
+
+ case WM_QUERYDRAGICON:
+ {
+ const wxIcon& icon = GetIcon();
+ HICON hIcon = icon.IsOk() ? GetHiconOf(icon)
+ : (HICON)GetDefaultIcon();
+ rc = (WXLRESULT)hIcon;
+ processed = rc != 0;
+ }
+ break;
+#endif // !__WXMICROWIN__