Handling WM_SIZING for Dialogs

Posted on 1998-01-27
Last Modified: 2013-11-19
I have a dialog box implementing Grid view of a Database.
The dialog contains a maximize/minimize button. I'd also
like to implement Onsizing for the Dialog but ClassWizard
does not provide this event for my dialog (It only provides
WM_SIZE which is good only for minimize/maximize).

ClassWizard however provides this event for the ActiveX control
that owns the dialog.

How do I proceed with this quest? Any pointers appreciated.
Question by:hakeem042997
  • 4
  • 2

Accepted Solution

tflai earned 100 total points
ID: 1314976
I'm not sure what you mean.  But you can resize a dialog box by changing its border style from "dialog frame" to "resizing".  In your WM_SIZE's OnSize() handler, you will know what size the user is setting it to be, and you can re-size/re-arrange controls in the dialog box.  Catch WM_GETMINMAXINFO to set the maximum/minimum size if you want to do it.
(WM_SIZE is sent whenever dialog is re-sized, not only on maximize/minimize.)

Author Comment

ID: 1314977
Thanks. But WM_GETMINMAXINFO is not available to be handled for my
dialog. It's only available ffor the ocx. Now is it enough to just
override OnGetMinMaxInfo() and call that inside OnSize().

More info appreciated.

Expert Comment

ID: 1314978
Add DefWindowProc() handler for your dialog box in the class wizard:

      lppt = (LPPOINT)lParam;   // lParam points to array of POINTs
      lppt[3].x = MinDialogSize.x;
      lppt[3].y = MinDialogSize.y;
      lppt[4].x = MaxDialogSize.x;
      lppt[4].y = MaxDialogSize.y;
      return DefWindowProc(hWnd, message, wParam, lParam);
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.


Author Comment

ID: 1314979
Thanks again, tflai. Looks like what 'am looking for.

Author Comment

ID: 1314980
Thanks again, tflai. Looks like what 'am looking for.

Author Comment

ID: 1314981
Thanks again, tflai. Looks like what 'am looking for.

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Get filename and folder into excel 7 67
Looking for a specific application/software 2 91
post4 challenge 28 83
mapAB Challlenge 35 88
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

758 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

19 Experts available now in Live!

Get 1:1 Help Now