Window Won't Maximize

Started by
7 comments, last by vbisme 23 years, 4 months ago
I'm trying to create a window that is initially maximize, but it won't!
    
///Create the main window

	if (!(hWnd = CreateWindowEx(NULL, "MainWinClass", "Main Window",
		WS_MAXIMIZE | WS_OVERLAPPEDWINDOW | WS_VISIBLE,
		0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
		NULL, NULL,
		hInstance, NULL)))
	{
		return(0);
	}//end if

    
And oh, while maximized, it's still "movable" ... how do I stop that? Edited by - vbisme on 11/27/00 10:26:03 PM
Advertisement
I think you should try calling maximaize during the CREATEWINDOW message. That way it will be momentarly non-maximized, but should work every time. Or you could initially set the window to the screen size.

Good luck
After you''ve created your window call

ShowWindow( hWnd, SW_SHOWMAXIMIZED );

Hope that helps ya...

n!
Both of those ways opens the window "then" maximize it. Is there not a way to maximize it "initialily" ?
The window doesn''t get displayed until you call ShowWindow. If ShowWindow isn''t called with SW_SHOWMAXIMIZED then it wont be shown maximized. If ShowWindow isn''t called at all then the window won''t be displayed at all.

n!
Try creating it without WS_VISIBLE then calling ShowWinodw

n!
What''s the point of WS_MAXIMIZE then if the windown won''t maximize?
WS_MAXIMIZE creates a window of the maximum size, not a window that is initially maximized.
The ShowWindow() method works, but the window is still "movable" ... how do I stop that?

This topic is closed to new replies.

Advertisement