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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help changing application's size to full screen at startup 1

Status
Not open for further replies.

lhilliard

Programmer
Apr 4, 2001
7
US
I am using Win 32 API (No MFC) and am trying to set the application's initial size to full screen. This is what I currently have:

Code:
hWnd=CreateWindow(szWindowClass,szTitle,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

I searched MSDN for help and found nothing except some talk on CW_USEDEFAULT. Can someone please help?
 
Hi

Im not sure but I think if you put:

| WS_MAXIMIZED,

after WS_OVERLAPEDWINDOW it my maximize your window.
 
I tried that and there was no difference. The screen did not come up maximized. Any other ideas?
 
I think I made a typo. Try:

WS_OVERLAPEDWINDOW | WS_MAXIMIZE

Does that work?
 
I have already tried WS_OVERLAPPEDWINDOW | WS_MAXIMIZE to no avail.

When I used WS_OVERLAPPED | WS_POPUP, the executable started but was only displayed as what appeared to be minimized along the Windows bar at the bottom of my screen. When I tried to right click to maximize or left click to maximize nothing happenned.
 
Hi

You can use the following:

for a SDI application:

At the end of the InitInstance Function, replace the SW_SHOW parameter of the function ShowWindow by SW_MAXIMIZE.

// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_MAXIMIZE);
m_pMainWnd->UpdateWindow();

for a Dialog-based application:

in the function OnInitDialog of the Dialog class, add this:

ShowWindow( SW_MAXIMIZE);

I dont' try here for MDI but I guess it would be the same as SDI.

HTH

Thierry
EMail: Thierry.Marneffe@swing.be




 
ShowWindow(hWnd,SW_MAXIMIZE) worked.

Thanks Thierry!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top