Home > Back-end >  Timer shut down effect
Timer shut down effect

Time:05-28

 void CALLBACK TimerProc 
(
The HWND HWND,
UINT nMsg,
UINT nTimerid,
DWORD dwTime
) {

//KillTimer (NULL, 1); Position 1
Keybd_event (VK_RETURN, 0, 0, 0).//button down
Keybd_event (KEYEVENTF_KEYUP VK_RETURN, 0, 0);//, button up, simulation "enter" command
KillTimer (NULL, 1);//position 2

};
Int main () {
SetTimer (NULL, 1, 1000, TimerProc);
MessageBox (NULL, TEXT (" 0000 "), NULL, MB_YESNO);
//KillTimer (NULL, 1); Position 3
While (1) {
MessageBox (NULL, TEXT (" 111111 "), NULL, MB_YESNO);
Sleep (2000);
}
system("PAUSE");
return 0;
}


Timer shut KillTimer method regardless of the unloading location 123, are not effective, where is need to modify?

CodePudding user response:

Less message loop,
  • Related