//应用实例
//Dlg6Dlg.h
class CDlg6Dlg : public CDialog
{
public:
CWindowSizeMange m_WinsizeManage;
protected:
virtual BOOL OnInitDialog();
afx_msg void OnSize(UINT nType, int cx, int cy);
//Dlg6Dlg.cpp
BEGIN_MESSAGE_MAP(CDlg6Dlg, CDialog)
//{{AFX_MSG_MAP(CDlg6Dlg)
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CDlg6Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
//记录控件位置
m_WinsizeManage.Init(m_hWnd);
return TRUE;
}
void CDlg6Dlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
m_WinsizeManage.ResizeWindow();
} |