Solved

MFC : adding a minimize box in a property sheet

Posted on 1998-04-07
8
583 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is UAC Virtualization in the Process (TASK) Manager? 4 4,808
dialer.exe 4 74
Need more details 5 193
Microsoft C++ code failing in executable that worked 9 144
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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