HOWTO: Use the Sleep API to Pause Program Execution in a DLL (260337)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q260337

SUMMARY

The Sleep application program interface (API), causes the current program to suspend execution for a specified number of milliseconds. This is useful when you need to pause code execution in a DLL or multi-threaded DLL.

MORE INFORMATION

Since you can not have an interface in a DLL, you can not use a WAIT or =INKEY function. The following code shows you how to declare the Sleep API and then how to call the Sleep API.

The number you pass to the API is in milliseconds.
DECLARE Integer Sleep IN Win32API Integer
=Sleep(5000)      && Pause for 5 seconds
				
NOTE: APIs are case sensitive. So, make sure that you type the command exactly as shown.

REFERENCES

(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Dean Christopher, Microsoft Corporation.


Modification Type:MinorLast Reviewed:7/13/2004
Keywords:kbAPI kbCodeSnippet kbhowto KB260337