Solved

MFC : adding a minimize box in a property sheet

Posted on 1998-04-07
8
570 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
  • 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
 

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
This video discusses moving either the default database or any database to a new volume.

706 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now