?
Solved

Disable Minimize Box in MDI Child Frame

Posted on 1998-09-10
2
Medium Priority
?
556 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
[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
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
duneram earned 200 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 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