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
Solved

Disable Minimize Box in MDI Child Frame

Posted on 1998-09-10
2
549 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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 LInux Boot partition remotly 3 96
not able to insert into temp table 68 169
sum67 challenge 35 108
Use of condition with 'serial' in ansible 2 71
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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.

828 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