Timers in Console Applications - Programmer

This is a discussion on Timers in Console Applications - Programmer ; I'm having trouble figuring out how to create and use a timer in Windows when you don't want to build an actual windowed application, but rather are making a console app. All examples I've found so tie timers directly into ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Timers in Console Applications

  1. Timers in Console Applications

    I'm having trouble figuring out how to create and use a timer in
    Windows when you don't want to build an actual windowed application,
    but rather are making a console app. All examples I've found so tie
    timers directly into the windows.

    For Example:

    http://msdn2.microsoft.com/en-us/lib...er(VS.80).aspx

    Any suggestions?

    PS I am NOT using dot net


  2. Re: Timers in Console Applications

    Dave wrote:
    > I'm having trouble figuring out how to create and use a timer in
    > Windows when you don't want to build an actual windowed application,
    > but rather are making a console app. All examples I've found so tie
    > timers directly into the windows.


    For timers that do not need a window you can use CreateWaitableTimer,
    Sleep, or timeSetEvent, or WaitForMultipleObjects with a timeout. But
    since you don't have a message queue you have to invent your own system
    for figuring out how to integrate the timer notification with your
    application code.

    --
    Scott McPhillips [VC++ MVP]


+ Reply to Thread