- HWND hClient;
- HWND hTitlebar = NULLHANDLE;
- HWND hHScroll = NULLHANDLE;
- HWND hVScroll = NULLHANDLE;
- HWND hMenuBar = NULLHANDLE;
- SWP vSwp;
- SWP vSwpTitlebar;
- SWP vSwpVScroll;
- SWP vSwpHScroll;
- SWP vSwpMenu;
-
- //
- // Send anything to initialize the frame
- //
- WinQueryWindowPos(GetHwnd(), &vSwp);
- hClient = WinWindowFromID(GetHwnd(), FID_CLIENT);
- hTitlebar = WinWindowFromID(GetHwnd(), FID_TITLEBAR);
- WinQueryWindowPos(hTitlebar, &vSwpTitlebar);
- hHScroll = WinWindowFromID(GetHwnd(), FID_HORZSCROLL);
- WinQueryWindowPos(hHScroll, &vSwpHScroll);
- hVScroll = WinWindowFromID(GetHwnd(), FID_VERTSCROLL);
- WinQueryWindowPos(hVScroll, &vSwpVScroll);
- hMenuBar = WinWindowFromID(GetHwnd(), FID_MENU);
- WinQueryWindowPos(hMenuBar, &vSwpMenu);
- WinSetWindowPos( hClient
- ,HWND_TOP
- ,SV_CXSIZEBORDER
- ,(SV_CYSIZEBORDER - 1) + vSwpHScroll.cy
- ,vSwp.cx - ((SV_CXSIZEBORDER * 2) + vSwpVScroll.cx)
- ,vSwp.cy - ((SV_CYSIZEBORDER * 2) + 1 + vSwpTitlebar.cy + vSwpMenu.cy + vSwpHScroll.cy)
- ,SWP_SIZE | SWP_MOVE
- );
- ::WinShowWindow(GetHwnd(), (BOOL)bShowCmd);
- ::WinShowWindow(hClient, (BOOL)bShowCmd);