SW_SHOWMAXIMIZED NOT WORKING
-
Hi All, I have created a MFC application with CFormView as the base class in Visual Studio 2008.The problem i am facing is that inspite of me having the below code
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow(); when the aplication starts up it is not shown as maximized window. Please help me in this. Thanking in advance, Ashwath.
-
Hi All, I have created a MFC application with CFormView as the base class in Visual Studio 2008.The problem i am facing is that inspite of me having the below code
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow(); when the aplication starts up it is not shown as maximized window. Please help me in this. Thanking in advance, Ashwath.
Where did You call this function ? Please, show your code ...
-
Hi All, I have created a MFC application with CFormView as the base class in Visual Studio 2008.The problem i am facing is that inspite of me having the below code
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow(); when the aplication starts up it is not shown as maximized window. Please help me in this. Thanking in advance, Ashwath.
I've never tried maximizing a form view based application, and in fact I modify the code to prevent that since only the frame maximizes - the controls stay where originally placed and in their original size...it just looks bad in my opinion. Having said that, however, you may find your problem is caused by the view class. In a form view based app, the OnInitialUpdate in the view class contains the line
ResizeParentToFit();
This resizes the main frame to fit the form you created. As I say, I haven't done this, but perhaps if you comment out that line, you may succeed with your maximizing. Good luck.
Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
-
Hi All, I have created a MFC application with CFormView as the base class in Visual Studio 2008.The problem i am facing is that inspite of me having the below code
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow(); when the aplication starts up it is not shown as maximized window. Please help me in this. Thanking in advance, Ashwath.
I also think that resizing the form view without any other adjustments can end with unexpected issues in your controls or looking not so "nice". Anyways, have you tried to add the SW_SHOWMAXIMIZED to the default modes? I mean:
pMainFrame->ShowWindow(m\_nCmdShow | SW\_SHOWMAXIMIZED); pMainFrame->UpdateWindow();
This is to be called in your
CYourApp::OnInitInstance ()
Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpfull answers is nice, but saying thanks can be even nicer.