我有一個計時器類,它使用CreateTimerQueueTimer和DeleteTimerQueueTimer。按照預期,我會收到類對象的回調。如何確保計時器在應用程序忙於繪製UI或執行一些精細渲染等時不會觸發?我不關心高分辨率,只是在應用程序空閒時它必須啓動。定時器在Win32中,C++
我正在使用以下來創建計時器。
BOOL timerCreated = ::CreateTimerQueueTimer(&mTimerRef,
NULL,
TimerCallback,
(PVOID)(this),
inFireDelay * 1000,
inInterval * 1000,
WT_EXECUTEINUITHREAD);
// using timer queues because i dont have access to a hWnd in this class.
對不起,我不能僅使用MFC/.NET stictly win32。
謝謝, Abhinay。
謝謝,我想確保我的回調函數不會影響UI響應。 – 2010-10-05 17:56:27