使用SetTimerWindows无窗口计时器的实现 上传者:大渣吼吾系渣渣辉 2019-01-15 09:17:34上传 其他文件 500kb 热度 35次 下载地址 用户评论 更多下载 下载地址 立即下载 用户评论 DuDu_55684 2024-12-27 06:08:59 无用,很简单的代码使用SetTimer,Windows无窗口计时器的实现 #include #include #define IDT_TIMER 100 void CALLBACK TimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime) { SYSTEMTIME st; GetLocalTime(&st); printf("%2d:%2d:%2d.%3d hello!\n", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); } int main(int argc, char* argv[]) { int iret = SetTimer(NULL, IDT_TIMER, 1000, (TIMERPROC)TimerProc); MSG msg; while (1) { GetMessage(&msg, NULL, 0, 0); DispatchMessage(&msg); } return 0; } 发表评论
无用,很简单的代码使用SetTimer,Windows无窗口计时器的实现 #include #include #define IDT_TIMER 100 void CALLBACK TimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime) { SYSTEMTIME st; GetLocalTime(&st); printf("%2d:%2d:%2d.%3d hello!\n", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); } int main(int argc, char* argv[]) { int iret = SetTimer(NULL, IDT_TIMER, 1000, (TIMERPROC)TimerProc); MSG msg; while (1) { GetMessage(&msg, NULL, 0, 0); DispatchMessage(&msg); } return 0; }