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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add DefWindowProc() handler for your dialog box in the class wizard:
CMyDialogBox::DefWindowPro c(.....)
{
.....
.....
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;
.....
.....
CMyDialogBox::DefWindowPro
{
.....
.....
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;
.....
.....
ASKER
Thanks again, tflai. Looks like what 'am looking for.
ASKER
Thanks again, tflai. Looks like what 'am looking for.
ASKER
Thanks again, tflai. Looks like what 'am looking for.
ASKER
dialog. It's only available ffor the ocx. Now is it enough to just
override OnGetMinMaxInfo() and call that inside OnSize().
More info appreciated.