本文整理汇总了C++中TIMER::proc方法的典型用法代码示例。如果您正苦于以下问题:C++ TIMER::proc方法的具体用法?C++ TIMER::proc怎么用?C++ TIMER::proc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIMER
的用法示例。
在下文中一共展示了TIMER::proc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PeekMessageEx
//.........这里部分代码省略.........
pMsgQueue->dwState &= ~QS_DESKTIMER;
}
return TRUE;
}
#endif
if (pMsgQueue->TimerMask && IS_MSG_WANTED(MSG_TIMER)) {
int slot;
TIMER* timer;
#ifndef _LITE_VERSION
if (hWnd == HWND_DESKTOP) {
pMsg->hwnd = hWnd;
pMsg->message = MSG_TIMER;
pMsg->wParam = 0;
pMsg->lParam = 0;
SET_PADD (NULL);
if (uRemoveMsg == PM_REMOVE) {
pMsgQueue->TimerMask = 0;
}
UNLOCK_MSGQ (pMsgQueue);
return TRUE;
}
#endif
/* get the first expired timer slot */
slot = pMsgQueue->FirstTimerSlot;
do {
if (pMsgQueue->TimerMask & (0x01 << slot))
break;
slot ++;
slot %= DEF_NR_TIMERS;
if (slot == pMsgQueue->FirstTimerSlot) {
slot = -1;
break;
}
} while (TRUE);
pMsgQueue->FirstTimerSlot ++;
pMsgQueue->FirstTimerSlot %= DEF_NR_TIMERS;
if ((timer = __mg_get_timer (slot))) {
unsigned int tick_count = timer->tick_count;
timer->tick_count = 0;
pMsgQueue->TimerMask &= ~(0x01 << slot);
if (timer->proc) {
BOOL ret_timer_proc;
/* unlock the message queue when calling timer proc */
UNLOCK_MSGQ (pMsgQueue);
/* calling the timer callback procedure */
ret_timer_proc = timer->proc (timer->hWnd,
timer->id, tick_count);
/* lock the message queue again */
LOCK_MSGQ (pMsgQueue);
if (!ret_timer_proc) {
/* remove the timer */
__mg_remove_timer (timer, slot);
}
}
else {
pMsg->message = MSG_TIMER;
pMsg->hwnd = timer->hWnd;
pMsg->wParam = timer->id;
pMsg->lParam = tick_count;
SET_PADD (NULL);
UNLOCK_MSGQ (pMsgQueue);
return TRUE;
}
}
}
UNLOCK_MSGQ (pMsgQueue);
#ifndef _LITE_VERSION
if (bWait) {
/* no message, wait again. */
sem_wait (&pMsgQueue->wait);
goto checkagain;
}
#else
/* no message, idle */
if (bWait) {
pMsgQueue->OnIdle (pMsgQueue);
goto checkagain;
}
#endif
/* no message */
return FALSE;
}