-
May 30th, 2007, 01:17 AM
#1
disabling maximize option in SDI window
Hi all,
I have made a sdi application. i want that my sdi application window should always remain in restore form it should never get maximized. How to disable maximize window option....
thanks in advance
-
May 30th, 2007, 01:26 AM
#2
Re: disabling maximize option in SDI window
In function PreCreateWindow remove the WS_MAXIMIZE and WS_MAXIMIZEBOX.
Code:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style &= (~WS_MAXIMIZE & ~WS_MAXIMIZEBOX);
return TRUE;
}
-
May 30th, 2007, 01:40 AM
#3
Re: disabling maximize option in SDI window
Hello,
You can disable maximize button by removing the corresponding style after the window is created. In OnCreate function of CMainFrame class, add the line as shown below to remove the style.
Code:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
ModifyStyle(WS_MAXIMIZEBOX, 0);
...
}
Regards,
Pravin.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|