win32 timer

来源:互联网 发布:如何处理大数据 编辑:程序博客网 时间:2024/05/17 05:50

// Timer.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <stdio.h>
#include <windows.h>

void CALLBACK TimerProc(HWND hwnd, UINT message, UINT timerID, DWORD time)
{
 MessageBeep(-1);
}

int main(void)
{
 MSG msg;

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

 return 0;
}

原创粉丝点击