Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I've just started programming for

Status
Not open for further replies.

serpento

Programmer
Jun 16, 2002
92
GB
I've just started programming for Windows and want to know how to make a window maximized when it starts. I looked at the styles listed on MDSN and thought I'd add WS_MAXIMIZE to the style property when I use CreateWindow.
Code:
  hwnd = CreateWindow ("Window Class 1",
                       "Test Window!",
                       WS_OVERLAPPEDWINDOW | WS_MAXIMIZE,
                       CW_USEDEFAULT,
                       CW_USEDEFAULT,
                       CW_USEDEFAULT,
                       CW_USEDEFAULT,
                       NULL, NULL, hInstance, NULL);
Its very annoying that this has no effect; the window just opens normally as when I was just using WS_OVERLAPPEDWINDOW. Am I doing something wrong, or is there another way to make a window be maximized initially? Any help would be much appreciated.
-Ed ;-)

________________________________
Destiny is not a matter of chance; it is a matter of choice.
 
Immediately after calling [tt]CreateWindow[/tt], call [tt]ShowWindow(hwnd,SW_SHOWMAXIMIZED)[/tt].

Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top