// ----------------------------------------------------------------------------
void wxFrame::DoShowWindow(
- int nShowCmd
+ int bShowCmd
)
{
- ::WinShowWindow(GetHwnd(), nShowCmd);
- m_bIconized = nShowCmd == SWP_MINIMIZE;
+ HWND hClient;
+
+ //
+ // Send anything to initialize the frame
+ //
+ ::WinSendMsg( GetHwnd()
+ ,WM_UPDATEFRAME
+ ,(MPARAM)FCF_MENU
+ ,(MPARAM)0
+ );
+ hClient = ::WinWindowFromID(GetHwnd(), FID_CLIENT);
+ ::WinShowWindow(GetHwnd(), (BOOL)bShowCmd);
+ ::WinShowWindow(hClient, (BOOL)bShowCmd);
} // end of wxFrame::DoShowWindow
bool wxFrame::Show(
bool bShow
)
{
- DoShowWindow(bShow ? SWP_SHOW : SWP_HIDE);
+ SWP vSwp;
+
+ DoShowWindow((int)bShow);
if (bShow)
{
wxActivateEvent vEvent(wxEVT_ACTIVATE, TRUE, m_windowId);
+ ::WinQueryWindowPos(GetHwnd(), &vSwp);
+ m_bIconized = vSwp.fl & SWP_MINIMIZE;
::WinSetWindowPos( (HWND) GetHWND()
,HWND_TOP
- ,0
- ,0
- ,0
- ,0
- ,SWP_ZORDER
+ ,vSwp.x
+ ,vSwp.y
+ ,vSwp.cx
+ ,vSwp.cy
+ ,SWP_ZORDER | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE
);
vEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(vEvent);
{
HWND hWndParent = GetHwndOf(GetParent());
+ ::WinQueryWindowPos(hWndParent, &vSwp);
+ m_bIconized = vSwp.fl & SWP_MINIMIZE;
if (hWndParent)
::WinSetWindowPos( hWndParent
,HWND_TOP
- ,0
- ,0
- ,0
- ,0
- ,SWP_ZORDER
+ ,vSwp.x
+ ,vSwp.y
+ ,vSwp.cx
+ ,vSwp.cy
+ ,SWP_ZORDER | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE
);
}
}
{
wxFrameBase::SetIcon(rIcon);
- if (m_icon.Ok())
+ if ((m_icon.GetHICON()) != NULLHANDLE)
{
::WinSendMsg( GetHwnd()
,WM_SETICON
- ,(MPARAM)((HICON)m_icon.GetHICON())
+ ,(MPARAM)((HPOINTER)m_icon.GetHICON())
,NULL
);
::WinSendMsg( GetHwnd()
{
return FALSE;
}
+ //
+ // Send anything to initialize the frame
+ //
+ ::WinSendMsg( GetHwnd()
+ ,WM_UPDATEFRAME
+ ,(MPARAM)FCF_TASKLIST
+ ,(MPARAM)0
+ );
//
// Now size everything. If adding a menu the client will need to be resized.
,SWP_SIZE | SWP_MOVE
))
return FALSE;
+ WinQueryWindowPos(hClient, &vSwp);
return TRUE;
} // end of wxFrame::OS2Create