Re: Detect when suspended

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



There is a sample application in the Windows Mobile 5.0 SDK called PMSAMPLE
(directory \Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32\Powermanager)
that shows how to use CreateMsgQueue and RequestPowerNotifications to do
what you want to do. The app isn't MFC, just plain ole WIN32, but I think
the translation to MFC should be fairly trivial, mostly concerned with
creating the power notification thread.

The message queue used for power notifications is a CE point-to-point
message queue, which is a very efficient interprocess communication
mechanism unrelated to the windows message queues of GWES.

As for whether or not you will receive these notifications in the emulator
or not, I have not tested it myself, but I would strongly suspect that you
would. The mechanism is part of the core functionality of the CE power
manager, and it should be implemented fully in the emulator.

Tom Gensel (eMVP)


.



Relevant Pages

  • Re: How to Create our own Message Queue
    ... What message queue? ... Win32 already ... has this implemented and MFC uses it and provides mechanism such as ... Ajay Kalra ...
    (microsoft.public.vc.mfc)
  • Re: How to Create our own Message Queue
    ... already built into MFC. ... The wizard inserts code that looks like: ... How to Create our own Message Queue in VC++/MFC. ...
    (microsoft.public.vc.mfc)
  • MFC and RequestPowerNotifications
    ... I've been trying to use RequestPowerNotifications which depends on the ... MFC uses message maps. ... hide a message queue I can use to pass to RequestPowerNotifications? ...
    (microsoft.public.vc.mfc)