Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    C++ time function

    Hi guyz I am very new to C++ I want some help the question is
    What will be the code if I want the opened window to close after 3 seconds ?

    can anybody help me out of this....Thanx

  • #2
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    pseudo code:
    Code:
    SetTimer(0, NULL, 3000);
    
           ^ unique timer number
                ^ timer proc (not needed)
                      ^ callback time (3 seconds in milliseconds)
    
    Then in your message loop:
    
    if (msg.message == WM_TIMER)
           CloseWindow(hWnd);


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •