I am adding a function to my scripting language so that the program will wait . . . Is there a function call or maybe some API to make a program stop execution for a certain amount of time?
Printable View
I am adding a function to my scripting language so that the program will wait . . . Is there a function call or maybe some API to make a program stop execution for a certain amount of time?
Yes the Sleep API.
Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Sleep 1000 'Delay or wait for 1 second
theres another api call, bit more code needed, which allows events to happen whilst in sleep, such as use the min button etc.. i cant remember the name but somebody in here will surely know.
Try this that MartinLiss posted, works quite well.
http://www.vbforums.com/showthread.p...ferrerid=35425
If you need to be woken on a certain condition, WaitForSingleObject/WaitForMultipleObjects is useful.