Bonjour,
je souhaiterai utiliser le SetTimer() mais j'ai des problèmes avec:
J'utilise bien une fonction callback dans laquelle je vais écrire dans un fichier.
le problème C que mon Timer ne se lance mm pas .
Voici le code:
#include <windows.h>
#include <winuser.h>
#include "stdio.h"
int test;
void CALLBACK timer(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime )
{
FILE *fichier;
int erreur;
test=test+1;
fichier=fopen("c:\\toto.txt","w");
erreur=fputs("RING\n",fichier);
fclose(fichier);
}
void main(int argc, char* argv[])
{
printf("alarm application starting\n");
/* Set up a 5 second timer which calls alrm_bell */
SetTimer(0, 0, 5000,(TIMERPROC) timer);
}