How To Determine the Differences Between DoEvents and SleepLast reviewed: October 30, 1996Article ID: Q158175 |
The information in this article applies to:
SUMMARYThis article explains the differences between the Visual Basic DoEvents function and the Sleep() Windows API function.
MORE INFORMATIONDoEvents is a Visual Basic function that yields execution so the operating system can process other events. This function cleans out the message loop and executes any other pending business in the Visual Basic runtime. Upon completing the pending business execution, the function calls the Sleep function with zero (0) as the argument so that the remaining time slice can be used to check the queue. The Sleep 32-bit API function is a subset of the DoEvents function. The Visual Basic program calling the function and the Visual Basic runtime executable and interactions with Windows are immediately put to sleep by this function. The programs remain inactive for the time in milliseconds specified in the Sleep argument. The Sleep function allows you to specify the amount of time your applications are inactive. The DoEvents function returns control to the Visual Basic program after the operating system has finished processing the events in its queue and all keys in the SendKeys queue have been sent.
|
KBCategory: kbusage kbprg kbhowto
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |