Where should I catch WM_HIBERNATE and WM_CLOSE in Windows Mobile/WinCE?

Posted by afriza on Stack Overflow See other posts from Stack Overflow or by afriza
Published on 2010-04-23T03:37:13Z Indexed on 2010/04/23 3:43 UTC
Read the original article Hit count: 296

I have read about Windows Mobile's X button's behaviour, WM_HIBERNATE, and WM_CLOSE on Low Memory Situation.

MSDN on WM_HIBERNATE:

This message is sent to an application when system resources are running low. An application should attempt to release as many resources as possible when sent this message by unloading dialog boxes, destroying windows, or freeing up as much local storage as possible without changing the internal state.

MSDN on WM_CLOSE:

This message is sent as a signal that a window or an application should terminate.

Where should I catch the message? in the main message pump? in every window? or only some windows?

If I am using MFC, where should I catch it?

© Stack Overflow or respective owner

Related posts about windows-mobile

Related posts about wince