CBegin dlg;
    if(dlg.DoModal()!=IDCANCEL)
    {
        OnOK();
    }


BOOL CBegin::OnInitDialog() 
{
    CDialog::OnInitDialog();
    
    // TODO: Add extra initialization here
    SetTimer(1, 2000, NULL); //1:Specifies a nonzero timeridentifier
                             //2000:Specifies the time-out value, in milliseconds.
                             //NULL:Pointer to the function...if it's NULL, the system posts a WM_TIMER message to the application queue.
    
    return TRUE;  // return TRUE unless you set the focus to a control
                  // EXCEPTION: OCX Property Pages should return FALSE
}

void CBegin::OnTimer(UINT nIDEvent) 
{
    // TODO: Add your message handler code here and/or call default
    
    KillTimer(1); //1:the timer identifier
    CDialog::OnCancel();

    CDialog::OnTimer(nIDEvent);
}

相关文章:

  • 2021-05-05
  • 2021-07-18
  • 2022-02-25
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2021-12-04
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-07-01
  • 2022-12-23
  • 2022-01-02
相关资源
相似解决方案