Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than kernel32, prefix the name with the module name and a period.
<DllImport("kernel32.dll", SetLastError:=True)> _
Public Sub Sleep(MilliSeconds As UInteger)
End Sub
VB Signature:
Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Boo Signature:
[DllImport("kernel32.dll", SetLastError : true)]
def Sleep(dwMilliseconds as UInt32):
pass
User-Defined Types:
None.
Notes:
This allows you to call 'Sleep(INT)' and force your application to sleep INT milliseconds.
Tips & Tricks:
Use this often with Application.DoEvents()
Sample Code:
C#:
// code added by g. sharp @ http://www.paradisim.net
public class MainApp
{
[DllImport("kernel32.dll")]
static extern void Sleep(uint dwMilliseconds);
// code added by g. sharp @ http://www.paradisim.net
public class MainApp
{
[STAThread]
public static void Main()
{
Sleep(U2000); // pause for two seconds
System.Threading.Thread.Sleep(2000); // does the same thing
}
}
VB.NET :
<DllImport("kernel32.dll", SetLastError:=True)> _
Public Sub Sleep(MilliSeconds As UInteger)
End Sub
' code added by g. sharp @ http://www.paradisim.net
Public Class MainApp
<STAThread> _
Public shared Sub Main()
Sleep(2000) ' pause for two seconds
System.Threading.Thread.Sleep(2000) ' does the same thing
End Sub
End Class
VB :
Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Sleep 1000
Alternative Managed API:
System.Threading.Thread.Sleep()
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).