look into Waitable Timer Objects and Using Waitable Timer Objects to get insight into a suitable timer API. The SetWaitableTimer function allows to set a period to 3,600,000 ms, which represents the desired one hour period.
Example:
#include <windows.h>
#include <stdio.h>
int main()
{
HANDLE hTimer = NULL;
LARGE_INTEGER liDueTime;
liDueTime.QuadPart = -100000000LL;
// due time for the timer, negative means relative, in 100 ns units.
// This value will cause the timer to fire 10 seconds after setting for the first time.
LONG lPeriod = 3600000L;
// one hour period
// Create an unnamed waitable timer.
hTimer = CreateWaitableTimer(NULL, TRUE, NULL);
if (NULL == hTimer)
{
printf("CreateWaitableTimer failed, error=%d\n", GetLastError());
return 1;
}
printf("Waiting for 10 seconds...\n"); // as described with liDueTime.QuadPart
if (!SetWaitableTimer(hTimer, &liDueTime, lPeriod , NULL, NULL, 0))
{
printf("SetWaitableTimer failed, error=%d\n", GetLastError());
return 2;
}
// and wait for the periodic timer event...
while (WaitForSingleObject(hTimer, INFINITE) == WAIT_OBJECT_0) {
printf("Timer was signaled.\n");
// do what you want to do every hour here...
}
printf("WaitForSingleObject failed, error=%d\n", GetLastError());
return 3;
}