Re: Maximize in CFormView
I don't understand exactly your problem, but the best way to maximize a frame or a view at the initialization is to redefine the style in the PreCreateWindow() like that:
BOOL CMyFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= WS_MAXIMIZE;
return CMDIChildWnd::PreCreateWindow(cs);
}
good luck !
---------------------------------------------
Laurent BERNARD
Ingénieur Développement - Logiciel Visilog
NOESIS
6, rue de la réunion
91940 Les Ulis
E-mail : [email protected]
------------------------------------------------
Re: Maximize in CFormView
The most easiest way to start with a maximized form view is to register your own WndClass with WS_Maximized style, modify the CreateStruct to use your WndClass instead of standard window class. I did not test it against your special problems, but I do not remember to have encountered any of them...
hope this helps
chrislaw
Re: Maximize in CFormView
I may be wrong but I thought this does not work for Form Views?
chrislaw
Re: Maximize in CFormView
Actually, what is happening is a bug in a project created by AppWizard using SDI with CFormView. I don't want the window to be permanently maximized - I want it to be at the option of the user. The problem is that when a file is opened, the window is resized but the icon still indicates that it is maximized. I suspect that some member data which saves the size is not getting set properly and when the window is redrawn, the incorrect size is being used.
Re: Maximize in CFormView
with the method I proposed the window would still be resizable by user, other problems I have to try whether solved, but as you pointed out it may not be the solution.
(I did not intend to put the bug on your shoulders ;-)
chrislaw