1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| // timer2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
int countact=0;
VOID CALLBACK TimerProc( HWND hwnd,
UINT uMsg,
UINT_PTR idEvent,
DWORD dwTime
)
{
countact++;
printf("%d \0x1",countact);
}
int _tmain(int argc, _TCHAR* argv[])
{
SetTimer(NULL,NULL,1,TimerProc); //Précision au milli-seconde
while (1)
{
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
//if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
return 0;
} |
Partager