16,472
社区成员
发帖
与我相关
我的任务
分享
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime )
{
::PostMessage(NULL,WM_CLOSE,0,0);
}
UINT WaitDlgProc( LPVOID pParam )
{
CWaitDlg WaitDlg;
::SetTimer(WaitDlg.m_hWnd,1,1000,TimerProc);
WaitDlg.DoModal();
return 0;
}
CWaitDlg WaitDlg;
::SetTimer(WaitDlg.m_hWnd,1,1000,TimerProc);
WaitDlg.DoModal();
UINT WaitDlgProc( LPVOID pParam )
{
CWaitDlg WaitDlg;
WaitDlg.DoModal(); //显示对话框
return 0;
}
BOOL CWaitDlg::OnInitDialog() //CWaitDlg类WM_INITDIALOG消息处理函数
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetTimer(1,1000,NULL); //Set Timer
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CWaitDlg::OnTimer(UINT nIDEvent) //CWaitDlg的WM_TIMER消息处理函数
{
// TODO: Add your message handler code here and/or call default
OnOK(); //需要WaitDlg.DoModal()返回IDOK则调用这个。
//OnCancel(); //要返回IDCALCEL调用这个
//EndDialog(15); //也可以调用EndDialog(int Value);来返回任意Value值。
//CDialog::OnTimer(nIDEvent);
}