SetTimer的用法
我的程序中需要对定时器的时间不断进行调整,所以在定时器OnTimer响应函数中进行重置。
OnTimer(UINT nIDEvent)
{
i=rand()/100;
SetTimer(1,i,NULL);
。。。
}
我的问题是调用SetTimer之前,是否一定需要先关闭定时器1:KillTimer(1); 不写KillTimer(1)是否会占用资源。
请高手指教,谢谢了!
[解决办法]
不需.
[解决办法]
不需要的
[解决办法]
nIDEvent
[in] Specifies a nonzero timer identifier. If the hWnd parameter is NULL, this parameter is ignored. If the hWnd parameter is not NULL and the window specified by hWnd already has a timer with the value nIDEvent, then the existing timer is replaced by the new timer. When SetTimer replaces a timer, the timer is reset. Therefore, a message will be sent after the current time-out value elapses, but the previously set time-out value is ignored.
[解决办法]
不用的,调用SetTimer就是启动或复位定时器,使定时器以新的定时时间进行定时,KillTimer就是停止定时。
[解决办法]
不需要
[解决办法]
不需要,
[解决办法]
应该不需要吧