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

How to keep an SDI app. always maximized?

Status
Not open for further replies.

someTimeOnly

Technical User
Oct 12, 2003
78
PK
I'm developing an sdi graphic application.
I want to keep the app.
always maximized,
with disabled restore button &
with disabled resizing.

or
how to make only client area visible?(i.e., full screen and no title bar etc.)

any idea?

 
In your OnInitDialog have the following line:

ShowWindow(SW_MAXIMIZE);

This will start your panel maximised.

Dont exactly understand your other questions, but I think you want to stop the user changing the size of the application? If so go to your dialog window and look at the properties of it. There should be true/false toggles for "Maximise Box" and "Minimise Box", set these to false and the window cant be altered, I think there is also a toggle for title bar which can be switched to false.
 
>>Dont exactly understand your other questions

mmm... what's gone wrong with my question...

Actually it's only one question buddy...

I just want to make my SDI(not dialog based) app. with only client area visible. And there shouldn't be any title bar, menu bar , even no max/min button.

why?
wel... it's graphic app. and I might be providing all the user interactions some other way.

Got it...
 
Correction please

>>Got it...

doesn't mean I've got the solution
rather it says whether I'm making any sense to convey my message.

Give me some idea. I think it shouldn't be a big deal for u like programers.
 
Correction plz.

>>Got it...

doesn't mean that I'v got the solution
rather it says whether I'v conveyed my Q or not.

Give me some idea about my above problem.
 
Ok I get it, youve got it!!

Are all these options not detailed in the properties of your main window?

i.e.

Maximised (true or false)
Minimised ( true or false )
Title Bar ( true or false )
etc.....
 
I found an MSDN article
“HOWTO: Create MFC Applications that Do Not Have a Menu
Bar”

BOOL CMainFrame::preCreateWindow(CREATESTRUCT& cs){
if(cs.hMenu!=NULL){
::DestroyMenu(cs.hMenu); // delete menu if loaded
cs.hMenu = NULL; // no menu for this window
}
return CFrameWnd::preCreateWindow(cs);
}


and I also found somewhere on net how to avoid document name with the application name in the title bar by adding

cs.style &= ~FWS_ADDTOTITLE;

afterward I applied

cs.style &= ~WS_SYSMENU;
cs.style &= ~WS_THICKFRAME;
cs.style &= ~WS_SYSMENU;
cs.style &= ~WS_MINIMIZEBOX
cs.style &= ~WS_MAXIMIZEBOX

and got desired results.

Now one thing is still missing
I don’t want to see title bar at all.

HRGN hRgn=CreateRectRgn(0,30,650,650);//I don’t like these
// hrd coded values
m_pMainWnd->SetWindowRgn(hRgn,true);

This makes title bar to be washed away but my application is not covering the whole screen. Help me out with this problem.
 
Well move your app to 0,0 and using the function GetSystemMetrics (look it up in MSDN) set your app's height/width to the screen size.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top