Petit ajout par rapport à ce que dit BruNews :
La structure SYSTEMTIME est déclarée ainsi :
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
Donc tu peux facilement récupèrer les heures, minutes et secondes.
Voici un petit exemple d'utilisation très simple :
SYSTEMTIME sttm;
int sec=1;
GetLocalTime(&sttm);
while (true) {
GetLocalTime(&sttm);
if (sec != sttm.wSecond) {
printf("%i:%i:%i\n", sttm.wHour, sttm.wMinute, sttm.wSecond);
sec = sttm.wSecond;}}
DarK Sidious
Un API Viewer (pour le VB, VB.NET, C, C# et Delphi) : www.ProgOtoP.com/popapi/