Export (0) Print
Expand All

Application.SetSuspendState Method

Suspends or hibernates the system, or requests that the system be suspended or hibernated.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public static bool SetSuspendState (
	PowerState state,
	bool force,
	bool disableWakeEvent
)
public static boolean SetSuspendState (
	PowerState state, 
	boolean force, 
	boolean disableWakeEvent
)
public static function SetSuspendState (
	state : PowerState, 
	force : boolean, 
	disableWakeEvent : boolean
) : boolean
Not applicable.

Parameters

state

A PowerState indicating the power activity mode to which to transition.

force

true to force the suspended mode immediately; false to cause Windows to send a suspend request to every application.

disableWakeEvent

true to disable restoring the system's power status to active on a wake event, false to enable restoring the system's power status to active on a wake event.

Return Value

true if the system is being suspended, otherwise, false.

If an application does not respond to a suspend request within 20 seconds, Windows determines that it is in a non-responsive state, and that the application can either be put to sleep or terminated. Once an application responds to a suspend request, however, it can take whatever time it needs to clean up resources and shut down active processes.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft