count down from secs

This is a discussion on count down from secs within the Windows Programming forums, part of the Platform Specific Boards category; in a WIN32API program how would you count down from a certain number of seconds without delaying messages by using ...

  1. #1
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    count down from secs

    in a WIN32API program how would you count down from a certain number of seconds without delaying messages by using "sleep(int time)"
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,670
    Create a timer with SetTimer(HWND hwnd, int ID, int milliCycle);

    (I might have the last two params backwords)

    Anyway, set the milliSec duration to 1000, since that's a second...

    And be sure to kill the timer when your done with KillTimer(HWND hwnd, int ID);

    Oh yeah, do all you work in the case WM_TIMER switch...



    ITSA
    Socket Library!

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    Watch the accuracy of timer msg's as they have the lowest priority in the cue.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need some guidance.
    By Kinto in forum C Programming
    Replies: 10
    Last Post: 05-31-2009, 12:02 AM
  2. bintree and count (withouth using template)?
    By cubimongoloid in forum C++ Programming
    Replies: 7
    Last Post: 05-24-2009, 06:22 AM
  3. input question
    By piyush_v in forum C Programming
    Replies: 9
    Last Post: 04-12-2007, 07:09 AM
  4. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  5. count only lines of code...
    By flightsimdude in forum C Programming
    Replies: 13
    Last Post: 09-23-2003, 07:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21