Re: WM_HIBERNATE

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You can also catch the WM_HIBERNATE event through the
Microsoft.WindowsCE.Forms.MobileDevice class

Here's a short sample:

static void Main() {
Microsoft.WindowsCE.Forms.MobileDevice.Hibernate += new
EventHandler(MobileDevice_Hibernate);
Application.Run(new Form1());
}

static void MobileDevice_Hibernate(object sender, EventArgs e) {
// Do your stuff...
}


"<ctacke/>" <ctacke[at]opennetcf[dot]com> wrote in message
news:OaVC2x2DIHA.4752@xxxxxxxxxxxxxxxxxxxxxxx
Why do you feel you need to hook this message? For most cases, the CF
itself will handle this by calling GC.Collect when it sees the message.
It's not "imported" from anywhere. It's simply a defined constant that
can be found in the SDK headers (probably winuser.h if I were to guess).


--

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com

"Martin" <makungsbacka@xxxxxxxxxxx> wrote in message
news:C1FFA714-A780-4D2F-A42D-FD4FB8ADA57B@xxxxxxxxxxxxxxxx
Hi!

I am writing my very first Application for a Cell phone.

I am also struggeling to write it so it meets Microsofts demand for a
"True" Mobile application.

I need to hook the WM_HIBERNATE message, and i just cant figure out how.

I cant find it in the compact framework. Do i have to import it from a
DLL?

Any suggestions, links would be greatly appreciated.

Regards
Martin




.



Relevant Pages

  • Runtime exception using FileSystemWatcher - reproducible code included
    ... I've been using the FileSystemWatcher in Framework 1.1 and 2.0. ... static void CurrentDomain_UnhandledException(object sender, ... static void fsw_Created(object sender, FileSystemEventArgs e) ...
    (microsoft.public.dotnet.framework)
  • Re: Why the "RunWorkerCompleted" never comes after pressing ENTER?
    ... static void bw_DoWork(object sender, DoWorkEventArgs e) ... You need to check the CancellationPending property of the BackgroundWorker to see if you should cancel. ... static void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) ...
    (microsoft.public.dotnet.framework)
  • Cannot create a BitmapImage; IsDownloading always true
    ... IsDownloading property always reports true. ... static void image_DecodeFailed(object sender, ExceptionEventArgs e) { ... static void image_DownloadFailed(object sender, ExceptionEventArgs e) { ...
    (microsoft.public.dotnet.framework)
  • Re: Virtual Event doesnt behave as expected.
    ... static void inheritedClass_EventB ... static void inheritedBaseClass_EventB(object sender, EventArgs ... protected virtual void OnEventA() ...
    (microsoft.public.dotnet.languages.csharp)