Desktop Functions: Smart Device Functions:
|
Search Results for "sleep" in [All]winspool1: FlushPrinter
private static extern bool FlushPrinter(IntPtr hPrinter,IntPtr pBuf,Int32 cbBuf,out Int32 pcWritten,Int32 cSleep); ntdllusing System.Threading; // for test main (Thread.Sleep) only
Thread.Sleep(1500); Structures
public POWER_ACTION_POLICY SleepButtonAc;
public POWER_ACTION_POLICY SleepButtonDc;
Public SleepButtonAc As POWER_ACTION_POLICY
Public SleepButtonDc As POWER_ACTION_POLICY 4: KEYBDINPUT
///Computer Sleep key
SLEEP = 0x5F,
SLEEP = 95,
SYSTEM_POWER_STATE MinSleepAc;
SYSTEM_POWER_STATE MinSleepDc;
SYSTEM_POWER_STATE ReducedLatencySleepAc;
SYSTEM_POWER_STATE ReducedLatencySleepDc;
Private MinSleepAc As SYSTEM_POWER_STATE
Private MinSleepDc As SYSTEM_POWER_STATE
Private ReducedLatencySleepAc As SYSTEM_POWER_STATE
Private ReducedLatencySleepDc As SYSTEM_POWER_STATE
PowerActionSleep, // Sleep.
POWER_ACTION_LIGHTEST_FIRST = 0x10000000, // Uses the first lightest available sleep state.
PowerActionSleep ' Sleep.
POWER_ACTION_LIGHTEST_FIRST = 0x10000000 ' Uses the first lightest available sleep state.
public bool SleepButtonPresent;
PowerSystemSleeping1 = 2,
PowerSystemSleeping2 = 3,
PowerSystemSleeping3 = 4,
PowerSystemSleeping1 = 2
PowerSystemSleeping2 = 3
PowerSystemSleeping3 = 4
public SYSTEM_POWER_STATE MaxSleepAc;
public SYSTEM_POWER_STATE MaxSleepDc;
Public MaxSleepAc As SYSTEM_POWER_STATE
Public MaxSleepDc As SYSTEM_POWER_STATE user3210: DragDetect
System.Threading.Thread.Sleep(10); 11: GetGUIThreadInfo
Thread.Sleep(1000); 12: GetKeyboardState
VK_SLEEP = 0x5F, 13: GetKeyState
VK_SLEEP = 0x5F, 14: GetLastInputInfo Test it with: sleep 15; ./a.exe 15: keybd_event
16: MessageBeep
Thread.Sleep(1000);
Thread.Sleep(1000);
Thread.Sleep(1000);
Thread.Sleep(1000); 17: mouse_event
Thread.Sleep(100);
Thread.Sleep(100) 18: MoveWindow
Thread.Sleep(2000); 19: SendInput
Thread.Sleep(2500);
Start-Sleep 2 ; [Testing.Windows3]::SendInput($_inputArray.count, $_inputArray, [Runtime.InteropServices.marshal]::SizeOf($_inputArray[0]))
System.Threading.Thread.Sleep(500); 21: SetParent
Thread.Sleep(1000);
Thread.Sleep(100);
Thread.Sleep(100) 22: ShowCursor
Threading.Thread.Sleep(5000) 'Wait 5 Seconds 23: VirtualKeyCodes
public const uint VK_SLEEP = 0x5F; ole32
System.Threading.Thread.Sleep((int)pause);
System.Threading.Thread.Sleep((int)pause); coredll
D3 = 3, // Sleep: partially powered with device initiated wake 27: SetDevicePower
D3, // Sleep: partially powered with device initiated wake To keep a device awake indefinitely, you can use SystemParametersInfo() (also in CoreDll) to query the three idle timeouts SPI_GETBATTERYIDLETIMEOUT, SPI_GETEXTERNALIDLETIMEOUT, and SPI_GETWAKEUPIDLETIMEOUT. Ignoring any values that are zero, use the minimum of these three values as your N, set a recurring timer to fire more often than every N seconds, and call SystemIdleTimerReset() every time it fires. When you're done with your critical operation, kill the timer, and the device will be able to sleep again. I tried this from C# and each idle-timeout value was 0, so I just called SystemIdleTimerReset() every 30 seconds during the critical operation.
private static int nDisableSleepCalls = 0;
private static System.Threading.Timer preventSleepTimer = null;
public static void DisableDeviceSleep()
nDisableSleepCalls++;
if (nDisableSleepCalls == 1)
Debug.Assert(preventSleepTimer == null);
preventSleepTimer = new System.Threading.Timer(new TimerCallback(PokeDeviceToKeepAwake),
public static void EnableDeviceSleep()
nDisableSleepCalls--;
if (nDisableSleepCalls == 0)
Debug.Assert(preventSleepTimer != null);
if (preventSleepTimer != null)
preventSleepTimer.Dispose();
preventSleepTimer = null; kernel3229: CreateNamedPipe
System.Threading.Thread.Sleep(dataRead ? 50 : 1000);
System.Threading.Thread.Sleep(1000);
status = "Disk is sleeping"; 31: GetThreadContext
Thread.Sleep(1000); 32: GetTickCount
// Optional - Sleep for a bit...
// Thread.Sleep(10);
System.Threading.Thread.Sleep(1000); 34: SetCommBreak
Sleep(5); Setting a flag without also using ES_CONTINUOUS merely resets the idle timer, so it does not prevent sleep for an extended period.
void PreventSleep ()
// Prevent Idle-to-Sleep (monitor not affected) (see note above) 36: Sleep
static extern void Sleep(uint dwMilliseconds);
Public Sub Sleep(MilliSeconds As UInteger)
Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) This allows you to call 'Sleep(INT)' and force your application to sleep INT milliseconds.
static extern void Sleep(uint dwMilliseconds);
Sleep(U2000); // pause for two seconds
System.Threading.Thread.Sleep(2000); // does the same thing
Public Sub Sleep(MilliSeconds As UInteger)
Sleep(2000) ' pause for two seconds
System.Threading.Thread.Sleep(2000) ' does the same thing
Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Sleep 1000
System.Threading.Thread.Sleep() Enums37: POWER_ACTION
PowerActionSleepPowerActionSleep, 38: SystemPowerState
PowerSystemSleeping1PowerSystemSleeping1 = 2,
PowerSystemSleeping2PowerSystemSleeping2 = 3,
PowerSystemSleeping3PowerSystemSleeping3 = 4, 39: VirtualKeys
Sleep = 0x5F,
VK_SLEEP = &H5F ' // [Sleep] = 095 40: VK
///Computer Sleep key
SLEEP = 0x5F,
SLEEP = 95 powrprof
/// Check out if there is a sleep botton present in the system.
public static bool SleepButtonPresent
return systemPowerCapabilites.SleepButtonPresent; 42: QueryFlags
/// The device supports system sleep state S0.
/// The device supports system sleep state S1.
/// The device supports system sleep state S2.
/// The device supports system sleep state S3.
/// The device supports system sleep state S4.
/// The device supports system sleep state S5.
/// The device supports waking from system sleep state S0.
/// The device supports waking from system sleep state S1.
/// The device supports waking from system sleep state S2.
/// The device supports waking from system sleep state S3.
/// Check whether the device is currently enabled to wake the system from a sleep state. 44: SetSuspendState
namespace Sleeper
/// Suspends the system by shutting power down. Depending on the Hibernate parameter, the system either enters a suspend (sleep) state or hibernation (S4).
// Sleeps the machine advapi32
D3, // Sleep: partially powered with device initiated wake
D3 'Sleep: partially powered with device initiated wake |