c/c++ windows控制台 timmer

来源:互联网 发布:淘宝店铺号怎么隐藏 编辑:程序博客网 时间:2024/06/06 17:39

#include "windows.h"
#include <iostream>

 

using namespace std;
void CALLBACK TimeProc(
    HWND hwnd,      
    UINT message,    
    UINT idTimer,    
    DWORD dwTime);

 

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

 SetTimer(NULL,1,1000,TimeProc);
 MSG   msg;  
  while(GetMessage(&msg,NULL,0,0))  
  {  
   if(msg.message==WM_TIMER)  
   {  
    DispatchMessage(&msg);  
   }  
  }  


 scanf(&a);
 return 0;
}

 

 

 

void CALLBACK TimeProc(
    HWND hwnd,      
    UINT message,    
    UINT idTimer,    
    DWORD dwTime)  
{
   cout<<"a timer comming"<<endl;
}

 

 

原创粉丝点击