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 ?
efauquemAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
efauquemAuthor Commented:
That works just great !

Eric
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.