Hi Stuart, I never thought about passing the WINDOWPLACEMENT in to the CMainFrame prior to calling CreateEx(...). In the handler for WM_CREATE GetClientRect(...) now returns the expected size so I can set splitters etc up fine. Thanks. Odd behaviour though in the case where the application was either closed from a minimized or maximized state. On restarting, the retrieved prior state is indicated by the WINDOWPLACEMENT.showCmd. When previously minimized or maximized is the case, in between the OnCreate(...) handler exiting and the following call to ShowWindow(...) something changes the WINDOWPLACEMENT.rcNormalPosition information to either the size and position of a minimized or a maximized window respectively. This then means when the User Restores, it 'restores' to exactly the same minimized or maximized size! To the eye the window stays as it was. I had to work around this by resetting the WINDOWPLACEMENT again after CreateEx returns. I found I also had to call ShowWindow with the retreived showCmd rather than nCmdShow and remove any saved WPF_RESTORETOMAXIMIZED flag.
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
// Saved WINDOWPLACEMENT is retreived here
...
**if(WindowPlacement.flags & WPF\_RESTORETOMAXIMIZED)
{
WindowPlacement.flags &= WPF\_SETMINPOSITION;
}**
CMainFrame wndMain(WindowPlacement);
wndMain.CreateEx();
**wndMain.SetWindowPlacement(&WindowPlacement);**
wndMain.ShowWindow(WindowPlacement.showCmd);
...
Why this is necessary I don't know. Anyway it all seems OK now so thanks.