Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 595
  • Last Modified:

MFC : adding a minimize box in a property sheet

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
efauquem
Asked:
efauquem
  • 4
  • 3
1 Solution
 
piano_boxerCommented:
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
 
efauquemAuthor Commented:
It is a standalone propertysheet application.
The property sheet is called by DoModal( ), so I'm afraid OnCreate( ) won't get called...

0
 
piano_boxerCommented:
What i ment to say:
Add a handler for the WM_CREATE message.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
efauquemAuthor Commented:
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
 
piano_boxerCommented:
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
 
efauquemAuthor Commented:
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
 
Seeker092397Commented:
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
 
efauquemAuthor Commented:
That works just great !

Eric
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now