Export (0) Print
Expand All

Application.SetSuspendState Method

Note: This method is new in the .NET Framework version 2.0.

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

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 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2015 Microsoft