timmay3141
Programmer
I have a SDI app using MFC which I want to be maximized when it is launched. I thought I could do this by going into the app's InitInstance and changing a line to this:
m_pMainWnd->ShowWindow(SW_MAXIMIZE);
This sort of works - but there is a bit of a problem. Firstly, you can see when the window is first created it is not maximized, but it immediately becomes maximized (it just looks bad). Secondly, I'm using Direct3D and initializing the perspective (which uses the window size) in OnInitialUpdate, which is unfortunately called before ShowWindow is called. This means that the perspective uses the non-maximized window's dimensions, and as a result the images look bad. I could move where I setup the perspective, but as I've never used DirectX in MFC before I don't know exactly where to move it to. Any help would be appreciated.
m_pMainWnd->ShowWindow(SW_MAXIMIZE);
This sort of works - but there is a bit of a problem. Firstly, you can see when the window is first created it is not maximized, but it immediately becomes maximized (it just looks bad). Secondly, I'm using Direct3D and initializing the perspective (which uses the window size) in OnInitialUpdate, which is unfortunately called before ShowWindow is called. This means that the perspective uses the non-maximized window's dimensions, and as a result the images look bad. I could move where I setup the perspective, but as I've never used DirectX in MFC before I don't know exactly where to move it to. Any help would be appreciated.