.NET Framework Class Library
MobileDevice.Hibernate Event

Provides access to the WM_HIBERNATE message in Windows CE.

Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in microsoft.windowsce.forms.dll)

Syntax

Visual Basic (Declaration)
Public Shared Event Hibernate As EventHandler
Visual Basic (Usage)
Dim handler As EventHandler

AddHandler MobileDevice.Hibernate, handler
C#
public static event EventHandler Hibernate
C++
public:
static event EventHandler^ Hibernate {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
J#
/** @event */
public static void add_Hibernate (EventHandler value)

/** @event */
public static void remove_Hibernate (EventHandler value)
JScript
JScript supports the use of events, but not the declaration of new ones.
Remarks

When memory pressure from running applications is intensive, Windows CE sends the WM_HIBERNATE message to top level windows. You can respond to this event in managed code with the Hibernate event.

You can provide code in an event handler to reduce resource usage to accommodate memory pressure from other applications running on the device. This event is specific only to the current thread.

Example

The following code example shows how to add and use an event handler for the Hibernate event.

Visual Basic
' Connect an event handler, 
' OnHibernate, to the Hibernate event.
AddHandler MobileDevice.Hibernate, AddressOf OnHibernate
C#
// Connect an event hander, OnHibernate, to the Hibernate event.
MobileDevice.Hibernate += new EventHandler(OnHibernate);
Visual Basic
' Respond to the Hibernate event.
Private Sub OnHibernate(sender As Object, e As EventArgs)

 ' Add code here to release cached resources
 ' for relieving memory pressure.

End Sub
C#
private void OnHibernate(object sender, EventArgs e)
{
   // Add code here to release cached resources
   // for relieving memory pressure.
 
}
.NET Framework Security

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .
Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Compact Framework

Supported in: 2.0
See Also

Tags :


Page view tracker