I have read about Windows Mobile's X button's behaviour and also about WM_HIBERNATE and WM_CLOSE which are sent on Low Memory Situation to all valid applications.
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.
Questions:
- Are the messages sent only to the top-level windows or all windows in valid applications?
- 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?