15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Missing borders on maximized window

Richard Stott -- rstott@redshift.com
Tuesday, March 11, 1997

Environment: VC++ 4.1, WIN 95

I'm creating my MDIFramwnde maximized, but would like to show the side
borders. Using ActivateFrame() I've been able to maximize it before it
appears on screen, but the window appears with left and right borders off
screen. I tried to re-set the CREATESTRUCT in Create() but that seems to
have no effect.

Thanks for any help!

Dick Stott





Mike Blaszczak -- mikeblas@nwlink.com
Sunday, March 16, 1997

[Mini-digest: 2 responses]

At 17:34 3/11/97 -0800, Richard Stott wrote:
>Environment: VC++ 4.1, WIN 95

>I'm creating my MDIFramwnde maximized, but would like to show the side
>borders. Using ActivateFrame() I've been able to maximize it before it
>appears on screen, but the window appears with left and right borders off
>screen. I tried to re-set the CREATESTRUCT in Create() but that seems to
>have no effect.

Maximized windows don't show their borders, by definition.

You might be able to hack up a solution by handling WM_GETMINMAXINFO, but
it seems like the real solution is to not maximize your window and, instead,
leave it normalized and size it just right.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
       One is too many and a million is not enough.
-----From: Carl Gunther 

See the article FAQ: Changing the Styles of a Window Created by MFC in
the VC 4.1 Help file, which states:

Changing Styles in an Existing Application

If you=92re using a version of Visual C++ prior to version 2.0 or changin=
g=20
window attributes in an existing application, follow the instructions in=20
the rest of this article instead.

To change the default window attributes used by a framework application=20
created with AppWizard, override the window=92s PreCreateWindow virtual=20
member function. PreCreateWindow allows an application to access the=20
creation process normally managed internally by the CDocTemplate class.=20
The framework calls PreCreateWindow just prior to creating the window.=20
By modifying the CREATESTRUCT parameter to PreCreateWindow, your=20
application can change the attributes used to create the window.

The CTRLBARS sample application, provided with MFC version 3.0 and=20
later, demonstrates this technique for changing window attributes.=20
Depending on what your application changes in PreCreateWindow, it may be=20
necessary to call the base class implementation of the function. You can=20
access the source code for the MFC General sample CTRLBARS using Sample=20
help.

The following discussion covers the SDI case and the MDI case...

etc.



Richard Stott wrote:
>=20
> Environment: VC++ 4.1, WIN 95
>=20
> I'm creating my MDIFramwnde maximized, but would like to show the side
> borders. Using ActivateFrame() I've been able to maximize it before it
> appears on screen, but the window appears with left and right borders o=
ff
> screen. I tried to re-set the CREATESTRUCT in Create() but that seems t=
o
> have no effect.
>=20
> Thanks for any help!
>=20
> Dick Stott

--=20
Check out the extensive Website of the Labor/Community Strategy Center
at http://www.igc.apc.org/lctr/

Check out the Website of Songs for Social Change
at http://globalvisions.org/cl/sfsc/

Copyright 1996 Carl E. Gunther.  Permission to reproduce this message
in text form for not-for-profit purposes freely granted provided that=20
the preceeding copyright notice is retained.






Become an MFC-L member | Вернуться в корень Архива |