m_hwnd// This example shows how to use CWnd::SetTimer, CWnd::KillTimer, and how to handle WM_TIMER messages. A timer is set up to send a WM_TIMER message to the main frame window every 2 seconds in OnStartTimer(). OnStopTimer will stop the timer by calling CWnd::KillTimer. OnTimer was set up through class wizard to handle WM_TIMER messages for the main frame window. In this example the PC speaker will beep every 2 seconds.void CMainFrame::OnStartTimer()
{
m_nTimer = SetTimer(1, 2000, 0);
}void CMainFrame::OnStopTimer()
{
KillTimer(m_nTimer);
}void CMainFrame::OnTimer(UINT nIDEvent)
{
MessageBeep(0xFFFFFFFF); // Beep // Call base class handler.
CMDIFrameWnd::OnTimer(nIDEvent);
}
{
m_nTimer = SetTimer(1, 2000, 0);
}void CMainFrame::OnStopTimer()
{
KillTimer(m_nTimer);
}void CMainFrame::OnTimer(UINT nIDEvent)
{
MessageBeep(0xFFFFFFFF); // Beep // Call base class handler.
CMDIFrameWnd::OnTimer(nIDEvent);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货