[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

Handling WM_SIZING for Dialogs

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
hakeem042997
Asked:
hakeem042997
  • 4
  • 2
1 Solution
 
tflaiCommented:
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
 
hakeem042997Author Commented:
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
 
tflaiCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
hakeem042997Author Commented:
Thanks again, tflai. Looks like what 'am looking for.
0
 
hakeem042997Author Commented:
Thanks again, tflai. Looks like what 'am looking for.
0
 
hakeem042997Author Commented:
Thanks again, tflai. Looks like what 'am looking for.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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