[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Disable Maximize and Size.

Posted on 1999-01-12
9
Medium Priority
?
561 Views
Last Modified: 2013-11-20
I made a Dialog based app, and I have the minimized button but the maximize is greyed out. If you right-click the system menu (the colored line on the top of the window) you still get the option to maximize and change size. I would like to disable them. Is that possible? I would like the code please since I'm new at MFC.
0
Comment
Question by:joakimf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 4

Accepted Solution

by:
nil_dib earned 100 total points
ID: 1327514
You can use the resource workshop to set the style of the dialog.
Open resource workshop
Open your dialog
View->Properties
Styles->check out the min/max checkbox
Or
Override the PreCreateWindow method (with the class wizzard) and set the style member of the CREATESTRUCT (cs) to WS_MAXIMIZEBOX/WS_MINIMIZEBOX :
cs.style &= ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX )

0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1327515
ouuchh
..and set the style member of the CREATESTRUCT....
should be
..and remove the WS_MAXIMIZEBOX/WS_MINIMIZEBOX flags from the style member of the CREATESTRUCT....
0
 
LVL 1

Author Comment

by:joakimf
ID: 1327516
Well, it's not the buttons. I want to be able to minimize the window with the button. I want to remove the maximize text in the right-click menu or atleast grey out.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:nil_dib
ID: 1327517
If you have one button enabled (min or max) then the other button is visible, but grayed out -> text in sysmenu is visible and grayed out.
If you have no button then there is no text in the sysmenu.
>> I would like to disable them
both buttons?
0
 
LVL 1

Author Comment

by:joakimf
ID: 1327518
The text Maximize is NOT grayed out but the button is.
0
 
LVL 1

Author Comment

by:joakimf
ID: 1327519
The text Maximize is NOT grayed out but the button is.
0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1327520
Ok, I see
the other way is to get the pointer of the sysmenu and to manipulate the menu with the CMenu member functions:

BOOL CMinDlg::OnInitDialog()
{
    CDialog::OnInitDialog();
    .....
    CMenu* pSysMenu = GetSystemMenu(FALSE);
    if (pSysMenu != NULL)
    {
        // e.g. remove the first string in the sysmenu
        pSysMenu->ModifyMenu(0,MF_BYPOSITION,MF_STRING);
        ......
look also for CMenu::EnableMenuItem and CMenu::InsertMenu

0
 

Expert Comment

by:SileNcer
ID: 1327521
hmm, if you are talking about disabling the text to the menu that appears on the dialog title, then just go to the dialog editor; goto properties of the dialog box and select "thin frame" for the dialog instead of "dialog frame."  Recompile your program and the maximize option in the menu should now be grayed out.
0
 
LVL 1

Author Comment

by:joakimf
ID: 1327522
Thank you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question