cpp文件中添加:
BEGIN_MESSAGE_MAP(CDlgImage, CDialog)
//{{AFX_MSG_MAP(CDlgImage)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CDlgImage::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_timerID1 = this->SetTimer(24, 50, NULL);
return TRUE; // return TRUE unless you set the focus to a control
}
void CDlgImage::OnTimer(UINT nIDEvent)
{
... ...
CDialog::OnTimer(nIDEvent);
KillTimer(m_timerID1);
}
头文件中添加:
UINT m_timerID1;
// Generated message map functions
//{{AFX_MSG(CDlgImage)
virtual BOOL OnInitDialog();
virtual void OnOK();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
阅读(1482) | 评论(0) | 转发(0) |