Solved

MFC : adding a minimize box in a property sheet

Posted on 1998-04-07
8
588 Views
Last Modified: 2013-12-03
Hi,

I'd like to add a minimize box in my property sheet.

I managed to have one displayed by calling ModifyStyle(0,WS_MINIMIZEBOX,0) in my property sheet class' InitDialog member function, but clicking on it won't make the window minimized !!

Any clue on how to solve this ?
0
Comment
Question by:efauquem
[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
  • 4
  • 3
8 Comments
 
LVL 4

Expert Comment

by:piano_boxer
ID: 1412576
Whats the parent of the propertysheet ?
Is it a stand-alone propertysheet app ?

If i create a property sheet, override OnCreate and modifies the
style there, then i can minimize it (but the mainframe window is minimized as well !!!).




0
 

Author Comment

by:efauquem
ID: 1412577
It is a standalone propertysheet application.
The property sheet is called by DoModal( ), so I'm afraid OnCreate( ) won't get called...

0
 
LVL 4

Expert Comment

by:piano_boxer
ID: 1412578
What i ment to say:
Add a handler for the WM_CREATE message.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:efauquem
ID: 1412579
I added one, but ad OnCreate() (WM_CREATE handler) isn't called when I use DoModal (), it doesn't change anything :

I have the minimize box but it doesn't minimize anything ...


0
 
LVL 4

Expert Comment

by:piano_boxer
ID: 1412580
The virtual function OnCreate in NOT THE SAME as the handler for the WM_CREATE message!.
The WM_CREATE is sendt to any window when it is beeing created.

0
 

Author Comment

by:efauquem
ID: 1412581
I think they are the same.
When you use Visual C++ to add a windows message handler for WM_CREATE, it creates a OnCreate( ) function.

0
 
LVL 1

Accepted Solution

by:
Seeker092397 earned 100 total points
ID: 1412582
Somehow PropertySheet object does not recognize minimize button as a part of system menu. What you can do is: you can add a message handler for WM_NCLBUTTONDOWN message. Whenever you press minimize button you will get to this function and as a wParam you will receive a hittest. Next portion of code will do everything:
if (HTMINBUTTON == nHitTest)
{
  if (IsIconic())
  {
    ShowWindow(SW_RESTORE);
  }
  else
  {
    ShowWindow(SW_SHOWMINIMIZED);
  }
}

0
 

Author Comment

by:efauquem
ID: 1412583
That works just great !

Eric
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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