![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Registered User
Join Date: Aug 2006
Posts: 3
|
Pause a program
"I need to call a function every 1 second in my Windows (GUI) program. I have tried the following:
Code: #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." |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
You need to execute a process message - you need to add a line in the while loop - telling the program to process all new input, so that it won't hang.
I have no idea how to do it in C++, in Delphi I would add: Application.Processmessages; -- I googled it and maybe you should try to add the following in the while loop: Application->ProcessMessages(); |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Poker Player
Industry Role:
Join Date: Jul 2003
Posts: 2,945
|
please DO NOT post biz thread on GFY.
Thank you. |
![]() |
![]() ![]() ![]() ![]() ![]() |