win32 Timer範例

 

#include "stdafx.h"
#include <Windows.h>

void CALLBACK TimerProc(HWND hwnd, UINT message, UINT timerID, DWORD time) {
 MessageBeep(-1);
 printf("%s\n","a");
}

int _tmain(int argc, _TCHAR* argv[]){
 MSG msg;

 SetTimer(NULL, 0, 3000, TimerProc);
 while (GetMessage(&msg, NULL, 0, 0)) {
  TranslateMessage(&msg);
  DispatchMessage(&msg);
 }
 KillTimer(NULL, 1);

 return 0;
}

arrow
arrow
    全站熱搜

    huenlil 發表在 痞客邦 留言(0) 人氣()