You can use a class for this CDialogResize. Just inherit from this class in the class the definition of your window and the definition of how to resize the control as a window is updated. These changes change the cascade, so you may have a window that resizes in one way, which also implements CDialogResize.
class CFooWindow : ... public CDialogResize<CFooWindow> {
BEGIN_MSG_MAP(CFooWindow)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
... more messages here
CHAIN_MSG_MAP(CDialogResize<CFooWindow>)
END_MSG_MAP()
BEGIN_DLGRESIZE_MAP(CFooWindow)
DLGRESIZE_CONTROL(IDC_WINDOW_TOP, DLSZ_SZIZE_X | DLSZ_SIZE_Y);
DLGRESIZE_CONTROL(IDC_WINDOW_BOTTOM, DLSZ_SZIZE_X | DLSZ_MOVE_Y);
END_DLGRESIZE_MAP()
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
DlgResize_Init();
}
.. the rest of your class here
}
, DLGRESIZE_GROUP() , , .
. - , . CDlgResize::OnSize(UINT nType, int cx, int cy) .