In my code I have the Sleep at 60000 or 1 minute.
How can I stop the sleep function while the function is sleeping?
Like after 30 seconds of sleeping I want the sleep to stop and activate a code.
Why not just change the sleep function to 30 seconds?
not sure, but maybe you could do something like
[php]int Sleep = 100;
if(GetAsyncKeyState(VK_))
{
Sleep = 30000;
}else{
Sleep = 60000
}
[/php]
Just a guess?
There is no way I know of other than this :
Code:
for(int i = 0; i < 60000; i++){
if(GetAsyncKeyState(...)&1){
break;
}
Sleep(1);
}
It will sleep for 60 seconds or until you press a key.
Before you call Sleep(), get the handle to the thread you're pausing and in another thread, call ResumeThread() whenever you want it to resume execution.
Not sure if this will work, just assuming Sleep() calls suspendThread() to pause for a certain amount of time.