+
+ //
+ // Create the client window. We must call the API from here rather than
+ // the static base class create because we need a separate handle
+ //
+ if ((hClient = ::WinCreateWindow( GetHwnd() // Frame is parent
+ ,zWclass // Custom client class
+ ,NULL // Window title
+ ,0 // No styles
+ ,0, 0, 0, 0 // Window position
+ ,NULLHANDLE // Owner
+ ,HWND_TOP // Sibling
+ ,FID_CLIENT // standard client ID
+ ,NULL // Creation data
+ ,NULL // Window Pres Params
+ )) == 0L)
+ {
+ return FALSE;
+ }
+
+ //
+ // Now size everything. If adding a menu the client will need to be resized.
+ //
+ if (!::WinSetWindowPos( GetHwnd()
+ ,HWND_TOP
+ ,nX
+ ,nY
+ ,nWidth
+ ,nHeight
+ ,SWP_SIZE | SWP_MOVE | SWP_ACTIVATE
+ ))
+ return FALSE;
+
+ WinQueryWindowPos(GetHwnd(), &vSwp);
+
+ if (ulCreateFlags & FCF_TITLEBAR)
+ {
+ hTitlebar = WinWindowFromID(GetHwnd(), FID_TITLEBAR);
+ WinQueryWindowPos(hTitlebar, &vSwpTitlebar);
+ }
+ if (ulCreateFlags & FCF_HORZSCROLL)
+ {
+ hHScroll = WinWindowFromID(GetHwnd(), FID_HORZSCROLL);
+ WinQueryWindowPos(hHScroll, &vSwpHScroll);
+ }
+ if (ulCreateFlags & FCF_VERTSCROLL)
+ {
+ hVScroll = WinWindowFromID(GetHwnd(), FID_VERTSCROLL);
+ WinQueryWindowPos(hVScroll, &vSwpVScroll);
+ }
+ if (!::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 + vSwpHScroll.cy)
+ ,SWP_SIZE | SWP_MOVE
+ ))
+ return FALSE;