Link to home
Start Free TrialLog in
Avatar of hakeem042997
hakeem042997

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of tflai
tflai

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hakeem042997
hakeem042997

ASKER

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.
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;
.....
.....
Thanks again, tflai. Looks like what 'am looking for.
Thanks again, tflai. Looks like what 'am looking for.
Thanks again, tflai. Looks like what 'am looking for.