?? timeset.cpp
字號(hào):
// TimeSet.cpp: implementation of the CTimeSet class.
#include "stdafx.h"
#include "TimeSet.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CTimeSet::CTimeSet()
{
TimerID=0;//定義定時(shí)器句柄
TimerRes=1;//分辨率
TimerDelay=50;//定時(shí)間隔ms
}
CTimeSet::~CTimeSet()
{
if(TimerID)
timeKillEvent(TimerID);
}
bool CTimeSet::Start(UINT delay,LPTIMECALLBACK pfun,DWORD dwUser, UINT res/*=1*/)
{
Stop();
TimerRes = res;
TimerDelay = delay;
TimerID = timeSetEvent(delay,res,pfun,dwUser,TIME_PERIODIC);
if(TimerID)
return true;
else
return false;
}
void CTimeSet::Stop()
{
if(TimerID)
timeKillEvent(TimerID);
TimerID=0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -