Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   Pause a program (http://www.programmingforums.org/showthread.php?t=11008)

titaniumdecoy Aug 8th, 2006 8:18 PM

Pause a program
 
I need to call a function every 1 second in my Windows (GUI) program. I have tried the following:

:

#include <windows.h>
...
while (true) {
    Sleep(1000);
}

This works, except it locks up the application between calls so nothing else can occur.

Does C++ (or the Windows API) have a built-in pause or timer function for this purpose? Thanks.

Game_Ender Aug 8th, 2006 8:37 PM

This is what I got from a search on Win32 timer. This is a very common task, I am sure a cursory search of whatever docs you have, for whatever GUI framework you are using should show you its particular way of doing things.

Dameon Aug 8th, 2006 8:59 PM

Game_Ender++

AntiNinja--

AntiNinja Aug 8th, 2006 9:00 PM

I know sry, didnt read the entire post. :(

titaniumdecoy Aug 9th, 2006 1:41 PM

I found the instructions that link gave were a little too complicated. This tutorial was much easier to follow.


All times are GMT -5. The time now is 12:49 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC