Solved

Disable Minimize Box in MDI Child Frame

Posted on 1998-09-10
2
545 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
Comment Utility
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
Comment Utility

you can restore the style by doing:


style |= WS_MINIMIZEBOX;
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now