- HWND hClient = NULLHANDLE;
- SWP vSwp;
-
- //
- // Reset the window position
- //
- hClient = WinWindowFromID(GetHwnd(), FID_CLIENT);
- WinQueryWindowPos(GetHwnd(), &vSwp);
- WinSetWindowPos( GetHwnd()
- ,HWND_TOP
- ,vSwp.x
- ,vSwp.y
- ,vSwp.cx
- ,vSwp.cy
- ,SWP_SIZE | SWP_MOVE | SWP_ACTIVATE
- );
- ::WinShowWindow(GetHwnd(), (BOOL)bShowCmd);
- ::WinShowWindow(hClient, (BOOL)bShowCmd);
-} // end of wxFrame::DoShowWindow
-
-bool wxFrame::Show(
- bool bShow
-)
-{
- SWP vSwp;
-
- DoShowWindow((int)bShow);
-
- if (bShow)
- {
- wxActivateEvent vEvent(wxEVT_ACTIVATE, TRUE, m_windowId);
-
- ::WinQueryWindowPos(GetHwnd(), &vSwp);
- m_bIconized = vSwp.fl & SWP_MINIMIZE;
- ::WinEnableWindow(GetHwnd(), TRUE);
- vEvent.SetEventObject(this);
- GetEventHandler()->ProcessEvent(vEvent);
- }
- else
- {
- //
- // Try to highlight the correct window (the parent)
- //
- if (GetParent())
- {
- HWND hWndParent = GetHwndOf(GetParent());
-
- ::WinQueryWindowPos(hWndParent, &vSwp);
- m_bIconized = vSwp.fl & SWP_MINIMIZE;
- if (hWndParent)
- ::WinSetWindowPos( hWndParent
- ,HWND_TOP
- ,vSwp.x
- ,vSwp.y
- ,vSwp.cx
- ,vSwp.cy
- ,SWP_ZORDER | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE
- );
- ::WinEnableWindow(hWndParent, TRUE);
- }
- }
- return TRUE;
-} // end of wxFrame::Show
-
-void wxFrame::Iconize(
- bool bIconize
-)
-{
- DoShowWindow(bIconize ? SWP_MINIMIZE : SWP_RESTORE);
-} // end of wxFrame::Iconize
-
-void wxFrame::Maximize(
- bool bMaximize)
-{
- DoShowWindow(bMaximize ? SWP_MAXIMIZE : SWP_RESTORE);
-} // end of wxFrame::Maximize
-
-void wxFrame::Restore()
-{
- DoShowWindow(SWP_RESTORE);
-} // end of wxFrame::Restore
-
-bool wxFrame::IsIconized() const
-{
- SWP vSwp;
- bool bIconic;
-
- ::WinQueryWindowPos(GetHwnd(), &vSwp);
-
- if (vSwp.fl & SWP_MINIMIZE)
- ((wxFrame*)this)->m_bIconized = TRUE;
- else
- ((wxFrame*)this)->m_bIconized = FALSE;
- return m_bIconized;
-} // end of wxFrame::IsIconized
-
-// Is it maximized?
-bool wxFrame::IsMaximized() const
-{
- SWP vSwp;
- bool bIconic;
-
- ::WinQueryWindowPos(GetHwnd(), &vSwp);
- return (vSwp.fl & SWP_MAXIMIZE);
-} // end of wxFrame::IsMaximized
-
-void wxFrame::SetIcon(
- const wxIcon& rIcon
-)
-{
- wxFrameBase::SetIcon(rIcon);
-
- if ((m_icon.GetHICON()) != NULLHANDLE)
- {
- ::WinSendMsg( GetHwnd()
- ,WM_SETICON
- ,(MPARAM)((HPOINTER)m_icon.GetHICON())
- ,NULL
- );
- ::WinSendMsg( GetHwnd()
- ,WM_UPDATEFRAME
- ,(MPARAM)FCF_ICON
- ,(MPARAM)0
- );
- }
-} // end of wxFrame::SetIcon