[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Handling WM_SIZING for Dialogs

Posted on 1998-01-27
6
Medium Priority
?
1,090 Views
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.
0
Comment
Question by:hakeem042997
[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
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
tflai earned 300 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.)
0
 

Author Comment

by:hakeem042997
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.
0
 
LVL 4

Expert Comment

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

CMyDialogBox::DefWindowProc(.....)
{
.....
.....
case WM_GETMINMAXINFO:
      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);
      break;
.....
.....
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

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

Author Comment

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

Author Comment

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 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