class CResizeDlg : public CDialog
{
// Construction
public:
CResizeDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CResizeDlg)
enum { IDD = IDD_RESIZE_DIALOG };
CButton m_ctrlButton;
CListBox m_ctrlList;
//}}AFX_DATA
..
// Generated message map functions
//{{AFX_MSG(CResizeDlg)
..
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
void CResizeDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if(m_ctrlList.GetSafeHwnd())
m_ctrlList.MoveWindow(10, 10, cx-20, cy-60);
if(m_ctrlButton.GetSafeHwnd())
m_ctrlButton.MoveWindow(10, cy-40, cx-20, 30);
}