Solved

Disable Minimize Box in MDI Child Frame

Posted on 1998-09-10
2
550 Views
Last Modified: 2013-11-20
Hello,

I try to disable the minimize box in one of my MDI child frame.  However, I cannot seem to disable the minimize box.  When I created this mdi child frame, the style I used was dwStyle = WS_CHILD | WS_OVERLAPPED | WS_CAPTION |WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX; I try to get the system menu of this mdi child frame to do the disabling.  Nothing seems to work.  I need to enable and disable this minimize box depending on certain state.

Thank you,

Jennifer
0
Comment
Question by:jli
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
duneram earned 50 total points
ID: 1322057
IF YOU have the handle to the window you can do this:

(In mfc the attribute (handle of window) is m_hWnd).

   long style;

   style = GetWindowLong(m_hWnd,GWL_STYLE);

    style &= ~WS_MINIMIZEBOX;
   SetWindowLong(m_hWnd, GWL_STYLE,style);
   InvalidateRect( NULL, TRUE);


It's not a matter of getting a menu item here.  All controls in Windows are 'windows' themselves so you just need to be doing the right functionality.



0
 
LVL 2

Expert Comment

by:duneram
ID: 1322058

you can restore the style by doing:


style |= WS_MINIMIZEBOX;
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
Expand macro to ask for filename column 8 37
Complete beginner needs help making a cron job 9 131
how to monitor remote shell execution on linux 9 107
wordcount challenge 11 148
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

730 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