MFC,win32,linux C中SetTimer定时器用法
一. MFC中SetTimer用法
参照http://blog.youkuaiyun.com/shaopengf/article/details/38147089
二. win32中SetTimer用法
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
#include <string.h>
using namespace std;
void Resp_fun();
int main()
{
DWORD dwTimerId;
dwTimerId=SetTimer(NULL,1,1000,NULL);//1000:1秒;NULL:这里没有回调函数,是按照时间到后去响应一个自定义的函数Resp_fun()。
{
DWORD dwTimerId;
dwTimerId=SetTimer(NULL,1,1000,NULL);//1000:1秒;NULL:这里没有回调函数,是按照时间到后去响应一个自定义的函数Resp_fun()。
MSG msg;
while(GetMessage(&msg, NULL, 0, 0))
{
if(取消定时条件)
{
KillTimer(NUL
while(GetMessage(&msg, NULL, 0, 0))
{
if(取消定时条件)
{
KillTimer(NUL

本文介绍了C语言在MFC和Win32环境下,以及Linux中如何使用SetTimer进行定时操作。针对MFC,详细引用了相关博客资源进行说明,而在Win32中也阐述了SetTimer的使用方法。
最低0.47元/天 解锁文章
872

被折叠的 条评论
为什么被折叠?



