Solved

Disable Minimize Box in MDI Child Frame

Posted on 1998-09-10
2
548 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 78
deburging in oracle form 12 99
How to determine file rename from EventLog ? 2 49
Not needed 13 112
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

770 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