Creating a window application that will perform certain action after every 10 minutes

225 views Asked by At

I was wondering would I still need to use a basic game loop for this particular operation?

3

There are 3 answers

0
Cătălin Pitiș On BEST ANSWER

You could create a timer and perform that action on WM_TIMER message handling or on timer proc function you specify when creating the timer.

See SetTimer and WM_TIMER.

0
Ben Voigt On

No, just use CreateWaitableTimer, SetWaitableTimer, and then use MsgWaitForMultipleObjects instead of GetMessage or PeekMessage in your event dispatch loop (typically in WinMain).

0
Peter Alexander On

You can implement timers more generally and portably by using the Boost Asio library.

Here's an example of creating an asynchronous timer.