1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "frame.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
36 #include "wx/dialog.h"
37 #include "wx/settings.h"
38 #include "wx/dcclient.h"
43 #include "wx/msw/private.h"
46 #include "wx/statusbr.h"
47 #include "wx/generic/statusbr.h"
48 #endif // wxUSE_STATUSBAR
51 #include "wx/toolbar.h"
52 #endif // wxUSE_TOOLBAR
54 #include "wx/menuitem.h"
57 #ifdef __WXUNIVERSAL__
58 #include "wx/univ/theme.h"
59 #include "wx/univ/colschem.h"
60 #endif // __WXUNIVERSAL__
62 // ----------------------------------------------------------------------------
64 // ----------------------------------------------------------------------------
66 extern const wxChar
*wxFrameClassName
;
68 #if wxUSE_MENUS_NATIVE
69 extern wxMenu
*wxCurrentPopupMenu
;
70 #endif // wxUSE_MENUS_NATIVE
72 // ----------------------------------------------------------------------------
74 // ----------------------------------------------------------------------------
76 BEGIN_EVENT_TABLE(wxFrameMSW
, wxFrameBase
)
77 EVT_ACTIVATE(wxFrameMSW::OnActivate
)
78 EVT_SYS_COLOUR_CHANGED(wxFrameMSW::OnSysColourChanged
)
81 #ifndef __WXUNIVERSAL__
82 IMPLEMENT_DYNAMIC_CLASS(wxFrame
, wxWindow
)
85 // ============================================================================
87 // ============================================================================
89 // ----------------------------------------------------------------------------
90 // static class members
91 // ----------------------------------------------------------------------------
94 #if wxUSE_NATIVE_STATUSBAR
95 bool wxFrameMSW::m_useNativeStatusBar
= TRUE
;
97 bool wxFrameMSW::m_useNativeStatusBar
= FALSE
;
99 #endif // wxUSE_NATIVE_STATUSBAR
101 // ----------------------------------------------------------------------------
102 // creation/destruction
103 // ----------------------------------------------------------------------------
105 void wxFrameMSW::Init()
111 // Data to save/restore when calling ShowFullScreen
113 m_fsOldWindowStyle
= 0;
114 m_fsStatusBarFields
= 0;
115 m_fsStatusBarHeight
= 0;
116 m_fsToolBarHeight
= 0;
118 m_fsIsMaximized
= FALSE
;
119 m_fsIsShowing
= FALSE
;
121 m_winLastFocused
= (wxWindow
*)NULL
;
123 // unlike (almost?) all other windows, frames are created hidden
127 bool wxFrameMSW::Create(wxWindow
*parent
,
129 const wxString
& title
,
133 const wxString
& name
)
135 if ( !wxTopLevelWindow::Create(parent
, id
, title
, pos
, size
, style
, name
) )
138 // the frame must have NULL parent HWND or it would be always on top of its
139 // parent which is not what we usually want (in fact, we only want it for
140 // frames with the special wxFRAME_TOOL_WINDOW style handled elsewhere)
141 if ( !MSWCreate(m_windowId
, NULL
, wxFrameClassName
, this, title
,
142 pos
.x
, pos
.y
, size
.x
, size
.y
, style
) )
145 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
147 wxModelessWindows
.Append(this);
152 wxFrameMSW::~wxFrameMSW()
154 m_isBeingDeleted
= TRUE
;
159 // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
160 void wxFrameMSW::DoGetClientSize(int *x
, int *y
) const
163 ::GetClientRect(GetHwnd(), &rect
);
166 if ( GetStatusBar() && GetStatusBar()->IsShown() )
168 int statusX
, statusY
;
169 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
170 rect
.bottom
-= statusY
;
172 #endif // wxUSE_STATUSBAR
174 wxPoint
pt(GetClientAreaOrigin());
184 void wxFrameMSW::DoSetClientSize(int width
, int height
)
186 // leave enough space for the status bar if we have (and show) it
188 wxStatusBar
*statbar
= GetStatusBar();
189 if ( statbar
&& statbar
->IsShown() )
191 height
+= statbar
->GetSize().y
;
193 #endif // wxUSE_STATUSBAR
195 wxTopLevelWindow::DoSetClientSize(width
, height
);
198 // ----------------------------------------------------------------------------
199 // wxFrameMSW: various geometry-related functions
200 // ----------------------------------------------------------------------------
202 void wxFrameMSW::Raise()
205 // no SetForegroundWindow() in Win16
206 wxFrameBase::Raise();
208 ::SetForegroundWindow(GetHwnd());
212 // generate an artificial resize event
213 void wxFrameMSW::SendSizeEvent()
217 RECT r
= wxGetWindowRect(GetHwnd());
219 (void)::PostMessage(GetHwnd(), WM_SIZE
,
220 IsMaximized() ? SIZE_MAXIMIZED
: SIZE_RESTORED
,
221 MAKELPARAM(r
.right
- r
.left
, r
.bottom
- r
.top
));
226 wxStatusBar
*wxFrameMSW::OnCreateStatusBar(int number
,
229 const wxString
& name
)
231 wxStatusBar
*statusBar
= NULL
;
233 #if wxUSE_NATIVE_STATUSBAR
234 if ( !UsesNativeStatusBar() )
236 statusBar
= (wxStatusBar
*)new wxStatusBarGeneric(this, id
, style
);
241 statusBar
= new wxStatusBar(this, id
, style
, name
);
244 // Set the height according to the font and the border size
245 wxClientDC
dc(statusBar
);
246 dc
.SetFont(statusBar
->GetFont());
249 dc
.GetTextExtent(_T("X"), NULL
, &y
);
251 int height
= (int)( (11*y
)/10 + 2*statusBar
->GetBorderY());
253 statusBar
->SetSize(-1, -1, -1, height
);
255 statusBar
->SetFieldsCount(number
);
260 void wxFrameMSW::PositionStatusBar()
262 if ( !m_frameStatusBar
)
266 GetClientSize(&w
, &h
);
268 m_frameStatusBar
->GetSize(&sw
, &sh
);
270 // Since we wish the status bar to be directly under the client area,
271 // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
272 m_frameStatusBar
->SetSize(0, h
, w
, sh
);
274 #endif // wxUSE_STATUSBAR
276 #if wxUSE_MENUS_NATIVE
278 void wxFrameMSW::AttachMenuBar(wxMenuBar
*menubar
)
280 wxFrameBase::AttachMenuBar(menubar
);
284 // actually remove the menu from the frame
285 m_hMenu
= (WXHMENU
)0;
286 InternalSetMenuBar();
288 else // set new non NULL menu bar
290 // Can set a menubar several times.
291 if ( menubar
->GetHMenu() )
293 m_hMenu
= menubar
->GetHMenu();
297 m_hMenu
= menubar
->Create();
301 wxFAIL_MSG( _T("failed to create menu bar") );
306 InternalSetMenuBar();
310 void wxFrameMSW::InternalSetMenuBar()
312 #ifndef __WXMICROWIN__
313 if ( !::SetMenu(GetHwnd(), (HMENU
)m_hMenu
) )
315 wxLogLastError(wxT("SetMenu"));
320 #endif // wxUSE_MENUS_NATIVE
322 // Responds to colour changes, and passes event on to children.
323 void wxFrameMSW::OnSysColourChanged(wxSysColourChangedEvent
& event
)
325 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE
));
329 if ( m_frameStatusBar
)
331 wxSysColourChangedEvent event2
;
332 event2
.SetEventObject( m_frameStatusBar
);
333 m_frameStatusBar
->GetEventHandler()->ProcessEvent(event2
);
335 #endif // wxUSE_STATUSBAR
337 // Propagate the event to the non-top-level children
338 wxWindow::OnSysColourChanged(event
);
341 // Pass TRUE to show full screen, FALSE to restore.
342 bool wxFrameMSW::ShowFullScreen(bool show
, long style
)
349 m_fsIsShowing
= TRUE
;
353 wxToolBar
*theToolBar
= GetToolBar();
355 theToolBar
->GetSize(NULL
, &m_fsToolBarHeight
);
357 // zap the toolbar, menubar, and statusbar
359 if ((style
& wxFULLSCREEN_NOTOOLBAR
) && theToolBar
)
361 theToolBar
->SetSize(-1,0);
362 theToolBar
->Show(FALSE
);
364 #endif // wxUSE_TOOLBAR
366 #ifndef __WXMICROWIN__
367 if (style
& wxFULLSCREEN_NOMENUBAR
)
368 SetMenu((HWND
)GetHWND(), (HMENU
) NULL
);
372 wxStatusBar
*theStatusBar
= GetStatusBar();
374 theStatusBar
->GetSize(NULL
, &m_fsStatusBarHeight
);
376 // Save the number of fields in the statusbar
377 if ((style
& wxFULLSCREEN_NOSTATUSBAR
) && theStatusBar
)
379 //m_fsStatusBarFields = theStatusBar->GetFieldsCount();
380 //SetStatusBar((wxStatusBar*) NULL);
381 //delete theStatusBar;
382 theStatusBar
->Show(FALSE
);
385 m_fsStatusBarFields
= 0;
386 #endif // wxUSE_STATUSBAR
388 // zap the frame borders
390 // save the 'normal' window style
391 m_fsOldWindowStyle
= GetWindowLong((HWND
)GetHWND(), GWL_STYLE
);
393 // save the old position, width & height, maximize state
394 m_fsOldSize
= GetRect();
395 m_fsIsMaximized
= IsMaximized();
397 // decide which window style flags to turn off
398 LONG newStyle
= m_fsOldWindowStyle
;
401 if (style
& wxFULLSCREEN_NOBORDER
)
402 offFlags
|= WS_BORDER
| WS_THICKFRAME
;
403 if (style
& wxFULLSCREEN_NOCAPTION
)
404 offFlags
|= (WS_CAPTION
| WS_SYSMENU
);
406 newStyle
&= (~offFlags
);
408 // change our window style to be compatible with full-screen mode
409 ::SetWindowLong((HWND
)GetHWND(), GWL_STYLE
, newStyle
);
411 // resize to the size of the desktop
414 RECT rect
= wxGetWindowRect(::GetDesktopWindow());
415 width
= rect
.right
- rect
.left
;
416 height
= rect
.bottom
- rect
.top
;
418 SetSize(width
, height
);
420 // now flush the window style cache and actually go full-screen
421 SetWindowPos((HWND
)GetHWND(), HWND_TOP
, 0, 0, width
, height
, SWP_FRAMECHANGED
);
423 wxSizeEvent
event(wxSize(width
, height
), GetId());
424 GetEventHandler()->ProcessEvent(event
);
433 m_fsIsShowing
= FALSE
;
436 wxToolBar
*theToolBar
= GetToolBar();
438 // restore the toolbar, menubar, and statusbar
439 if (theToolBar
&& (m_fsStyle
& wxFULLSCREEN_NOTOOLBAR
))
441 theToolBar
->SetSize(-1, m_fsToolBarHeight
);
442 theToolBar
->Show(TRUE
);
444 #endif // wxUSE_TOOLBAR
447 if ( m_fsStyle
& wxFULLSCREEN_NOSTATUSBAR
)
449 //CreateStatusBar(m_fsStatusBarFields);
452 GetStatusBar()->Show(TRUE
);
456 #endif // wxUSE_STATUSBAR
458 #ifndef __WXMICROWIN__
459 if ((m_fsStyle
& wxFULLSCREEN_NOMENUBAR
) && (m_hMenu
!= 0))
460 SetMenu((HWND
)GetHWND(), (HMENU
)m_hMenu
);
463 Maximize(m_fsIsMaximized
);
464 SetWindowLong((HWND
)GetHWND(),GWL_STYLE
, m_fsOldWindowStyle
);
465 SetWindowPos((HWND
)GetHWND(),HWND_TOP
,m_fsOldSize
.x
, m_fsOldSize
.y
,
466 m_fsOldSize
.width
, m_fsOldSize
.height
, SWP_FRAMECHANGED
);
477 bool wxFrameMSW::MSWCreate(int id
, wxWindow
*parent
, const wxChar
*wclass
, wxWindow
*wx_win
, const wxChar
*title
,
478 int x
, int y
, int width
, int height
, long style
)
481 // If child windows aren't properly drawn initially, WS_CLIPCHILDREN
482 // could be the culprit. But without it, you can get a lot of flicker.
485 if ( style
& wxCAPTION
)
487 if ( style
& wxFRAME_TOOL_WINDOW
)
488 msflags
|= WS_POPUPWINDOW
;
490 msflags
|= WS_OVERLAPPED
;
497 if (style
& wxMINIMIZE_BOX
)
498 msflags
|= WS_MINIMIZEBOX
;
499 if (style
& wxMAXIMIZE_BOX
)
500 msflags
|= WS_MAXIMIZEBOX
;
501 if (style
& wxTHICK_FRAME
)
502 msflags
|= WS_THICKFRAME
;
503 if (style
& wxSYSTEM_MENU
)
504 msflags
|= WS_SYSMENU
;
505 if ( style
& wxMINIMIZE
)
506 msflags
|= WS_MINIMIZE
;
507 if (style
& wxMAXIMIZE
)
508 msflags
|= WS_MAXIMIZE
;
509 if (style
& wxCAPTION
)
510 msflags
|= WS_CAPTION
;
511 if (style
& wxCLIP_CHILDREN
)
512 msflags
|= WS_CLIPCHILDREN
;
514 // Keep this in wxFrameMSW because it saves recoding this function
516 #if wxUSE_ITSY_BITSY && !defined(__WIN32__)
517 if (style
& wxTINY_CAPTION_VERT
)
518 msflags
|= IBS_VERTCAPTION
;
519 if (style
& wxTINY_CAPTION_HORIZ
)
520 msflags
|= IBS_HORZCAPTION
;
522 if (style
& wxTINY_CAPTION_VERT
)
523 msflags
|= WS_CAPTION
;
524 if (style
& wxTINY_CAPTION_HORIZ
)
525 msflags
|= WS_CAPTION
;
527 if ((style
& wxTHICK_FRAME
) == 0)
528 msflags
|= WS_BORDER
;
530 WXDWORD extendedStyle
= MakeExtendedStyle(style
);
532 // make all frames appear in the win9x shell taskbar unless
533 // wxFRAME_TOOL_WINDOW or wxFRAME_NO_TASKBAR is given - without giving them
534 // WS_EX_APPWINDOW style, the child (i.e. owned) frames wouldn't appear in it
535 #if !defined(__WIN16__) && !defined(__SC__)
536 if ( (style
& wxFRAME_TOOL_WINDOW
) ||
537 (style
& wxFRAME_NO_TASKBAR
) )
538 extendedStyle
|= WS_EX_TOOLWINDOW
;
539 else if ( !(style
& wxFRAME_NO_TASKBAR
) )
540 extendedStyle
|= WS_EX_APPWINDOW
;
543 if (style
& wxSTAY_ON_TOP
)
544 extendedStyle
|= WS_EX_TOPMOST
;
547 if (m_exStyle
& wxFRAME_EX_CONTEXTHELP
)
548 extendedStyle
|= WS_EX_CONTEXTHELP
;
552 if ( !wxWindow::MSWCreate(id
, parent
, wclass
, wx_win
, title
, x
, y
, width
, height
,
553 msflags
, NULL
, extendedStyle
) )
556 // Seems to be necessary if we use WS_POPUP
557 // style instead of WS_OVERLAPPED
558 if (width
> -1 && height
> -1)
559 ::PostMessage(GetHwnd(), WM_SIZE
, SIZE_RESTORED
, MAKELPARAM(width
, height
));
564 // Default activation behaviour - set the focus for the first child
566 void wxFrameMSW::OnActivate(wxActivateEvent
& event
)
568 if ( event
.GetActive() )
570 // restore focus to the child which was last focused
571 wxLogTrace(_T("focus"), _T("wxFrameMSW %08x activated."), m_hWnd
);
573 wxWindow
*parent
= m_winLastFocused
? m_winLastFocused
->GetParent()
580 wxSetFocusToChild(parent
, &m_winLastFocused
);
584 // remember the last focused child if it is our child
585 m_winLastFocused
= FindFocus();
587 // so we NULL it out if it's a child from some other frame
588 wxWindow
*win
= m_winLastFocused
;
591 if ( win
->IsTopLevel() )
595 m_winLastFocused
= NULL
;
601 win
= win
->GetParent();
604 wxLogTrace(_T("focus"),
605 _T("wxFrameMSW %08x deactivated, last focused: %08x."),
607 m_winLastFocused
? GetHwndOf(m_winLastFocused
)
614 // ----------------------------------------------------------------------------
615 // tool/status bar stuff
616 // ----------------------------------------------------------------------------
620 wxToolBar
* wxFrameMSW::CreateToolBar(long style
, wxWindowID id
, const wxString
& name
)
622 if ( wxFrameBase::CreateToolBar(style
, id
, name
) )
627 return m_frameToolBar
;
630 void wxFrameMSW::PositionToolBar()
633 ::GetClientRect(GetHwnd(), &rect
);
636 if ( GetStatusBar() )
638 int statusX
, statusY
;
639 GetStatusBar()->GetClientSize(&statusX
, &statusY
);
640 rect
.bottom
-= statusY
;
642 #endif // wxUSE_STATUSBAR
644 if ( GetToolBar() && GetToolBar()->IsShown() )
647 GetToolBar()->GetSize(&tw
, &th
);
649 if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL
)
658 // Use the 'real' MSW position here
659 GetToolBar()->SetSize(0, 0, tw
, th
, wxSIZE_NO_ADJUSTMENTS
);
662 #endif // wxUSE_TOOLBAR
664 // ----------------------------------------------------------------------------
665 // frame state (iconized/maximized/...)
666 // ----------------------------------------------------------------------------
668 // propagate our state change to all child frames: this allows us to emulate X
669 // Windows behaviour where child frames float independently of the parent one
670 // on the desktop, but are iconized/restored with it
671 void wxFrameMSW::IconizeChildFrames(bool bIconize
)
673 for ( wxWindowList::Node
*node
= GetChildren().GetFirst();
675 node
= node
->GetNext() )
677 wxWindow
*win
= node
->GetData();
679 // iconizing the frames with this style under Win95 shell puts them at
680 // the bottom of the screen (as the MDI children) instead of making
681 // them appear in the taskbar because they are, by virtue of this
682 // style, not managed by the taskbar - instead leave Windows take care
685 if ( win
->GetWindowStyle() & wxFRAME_TOOL_WINDOW
)
689 // the child MDI frames are a special case and should not be touched by
690 // the parent frame - instead, they are managed by the user
691 wxFrame
*frame
= wxDynamicCast(win
, wxFrame
);
693 #if wxUSE_MDI_ARCHITECTURE
694 && !wxDynamicCast(frame
, wxMDIChildFrame
)
695 #endif // wxUSE_MDI_ARCHITECTURE
698 frame
->Iconize(bIconize
);
703 WXHICON
wxFrameMSW::GetDefaultIcon() const
705 return (WXHICON
)(wxSTD_FRAME_ICON
? wxSTD_FRAME_ICON
706 : wxDEFAULT_FRAME_ICON
);
709 // ===========================================================================
710 // message processing
711 // ===========================================================================
713 // ---------------------------------------------------------------------------
715 // ---------------------------------------------------------------------------
717 bool wxFrameMSW::MSWTranslateMessage(WXMSG
* pMsg
)
719 if ( wxWindow::MSWTranslateMessage(pMsg
) )
722 #if wxUSE_MENUS && wxUSE_ACCEL && !defined(__WXUNIVERSAL__)
723 // try the menu bar accels
724 wxMenuBar
*menuBar
= GetMenuBar();
728 const wxAcceleratorTable
& acceleratorTable
= menuBar
->GetAccelTable();
729 return acceleratorTable
.Translate(this, pMsg
);
732 #endif // wxUSE_MENUS && wxUSE_ACCEL
735 // ---------------------------------------------------------------------------
736 // our private (non virtual) message handlers
737 // ---------------------------------------------------------------------------
739 bool wxFrameMSW::HandlePaint()
742 if ( GetUpdateRect(GetHwnd(), &rect
, FALSE
) )
744 #ifndef __WXMICROWIN__
747 HICON hIcon
= m_icon
.Ok() ? GetHiconOf(m_icon
)
748 : (HICON
)GetDefaultIcon();
750 // Hold a pointer to the dc so long as the OnPaint() message
751 // is being processed
753 HDC hdc
= ::BeginPaint(GetHwnd(), &ps
);
755 // Erase background before painting or we get white background
756 MSWDefWindowProc(WM_ICONERASEBKGND
, (WORD
)(LONG
)ps
.hdc
, 0L);
761 ::GetClientRect(GetHwnd(), &rect
);
763 // FIXME: why hardcoded?
764 static const int icon_width
= 32;
765 static const int icon_height
= 32;
767 int icon_x
= (int)((rect
.right
- icon_width
)/2);
768 int icon_y
= (int)((rect
.bottom
- icon_height
)/2);
770 ::DrawIcon(hdc
, icon_x
, icon_y
, hIcon
);
773 ::EndPaint(GetHwnd(), &ps
);
780 return wxWindow::HandlePaint();
785 // nothing to paint - processed
790 bool wxFrameMSW::HandleSize(int x
, int y
, WXUINT id
)
792 bool processed
= FALSE
;
793 #ifndef __WXMICROWIN__
798 // only do it it if we were iconized before, otherwise resizing the
799 // parent frame has a curious side effect of bringing it under it's
804 // restore all child frames too
805 IconizeChildFrames(FALSE
);
807 (void)SendIconizeEvent(FALSE
);
816 // iconize all child frames too
817 IconizeChildFrames(TRUE
);
819 (void)SendIconizeEvent();
830 #endif // wxUSE_STATUSBAR
834 #endif // wxUSE_TOOLBAR
836 wxSizeEvent
event(wxSize(x
, y
), m_windowId
);
837 event
.SetEventObject( this );
838 processed
= GetEventHandler()->ProcessEvent(event
);
844 bool wxFrameMSW::HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
)
848 // In case it's e.g. a toolbar.
849 wxWindow
*win
= wxFindWinFromHandle(control
);
851 return win
->MSWCommand(cmd
, id
);
854 // handle here commands from menus and accelerators
855 if ( cmd
== 0 || cmd
== 1 )
857 #if wxUSE_MENUS_NATIVE
858 if ( wxCurrentPopupMenu
)
860 wxMenu
*popupMenu
= wxCurrentPopupMenu
;
861 wxCurrentPopupMenu
= NULL
;
863 return popupMenu
->MSWCommand(cmd
, id
);
865 #endif // wxUSE_MENUS_NATIVE
867 if ( ProcessCommand(id
) )
876 bool wxFrameMSW::HandleMenuSelect(WXWORD nItem
, WXWORD flags
, WXHMENU hMenu
)
879 if ( flags
== 0xFFFF && hMenu
== 0 )
881 // menu was removed from screen
884 #ifndef __WXMICROWIN__
885 else if ( !(flags
& MF_POPUP
) && !(flags
& MF_SEPARATOR
) )
893 // don't give hints for separators (doesn't make sense) nor for the
894 // items opening popup menus (they don't have them anyhow) but do clear
895 // the status line - otherwise, we would be left with the help message
896 // for the previous item which doesn't apply any more
897 wxStatusBar
*statbar
= GetStatusBar();
900 statbar
->SetStatusText(wxEmptyString
);
902 #endif // wxUSE_STATUSBAR
907 wxMenuEvent
event(wxEVT_MENU_HIGHLIGHT
, item
);
908 event
.SetEventObject( this );
910 return GetEventHandler()->ProcessEvent(event
);
913 // ---------------------------------------------------------------------------
914 // the window proc for wxFrameMSW
915 // ---------------------------------------------------------------------------
917 long wxFrameMSW::MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
)
920 bool processed
= FALSE
;
925 // if we can't close, tell the system that we processed the
926 // message - otherwise it would close us
927 processed
= !Close();
934 UnpackCommand((WXWPARAM
)wParam
, (WXLPARAM
)lParam
,
937 processed
= HandleCommand(id
, cmd
, (WXHWND
)hwnd
);
941 #ifndef __WXMICROWIN__
946 UnpackMenuSelect(wParam
, lParam
, &item
, &flags
, &hmenu
);
948 processed
= HandleMenuSelect(item
, flags
, hmenu
);
954 processed
= HandlePaint();
957 #ifndef __WXMICROWIN__
958 case WM_QUERYDRAGICON
:
960 HICON hIcon
= m_icon
.Ok() ? GetHiconOf(m_icon
)
961 : (HICON
)GetDefaultIcon();
969 processed
= HandleSize(LOWORD(lParam
), HIWORD(lParam
), wParam
);
974 rc
= wxWindow::MSWWindowProc(message
, wParam
, lParam
);