Q: WM_HIBERNATE

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

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
 
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).
 
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...
}
 
Back
Top