Suspend event in Win CE

  • Thread starter Thread starter Krupa
  • Start date Start date
K

Krupa

Hi,

How can I trap an event when a Win CE device goes to suspend and
wakeup after suspend?

Thanks,
Krupa
 
Hi,

Krupa said:
Hi,

How can I trap an event when a Win CE device goes to suspend and
wakeup after suspend?

Take a look at Opennetcf.org they implement this.

Now you can be notified but you cannot prevent the device to change of mode
(iirc)
 
Thanks Igancio. I couldn't find it at opennetcf.org. Could you give me
a link to the article/code? Also, are there any APIs in coredll.dll
that I can use for this purpose?

Krupa
 
What exactly do you want to *do* when this happens? You need to realize
that you are *not* guaranteed that you will be notified of the suspend
*before* you wake up again. That is, you might not receive the notification
until after the device has been reawakened. Generally, you should not be
trying to react to suspend because of this limitation (and the limitation on
what you can do in response to the event, anyway).

Paul T.
 
Hi,

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
What exactly do you want to *do* when this happens? You need to realize
that you are *not* guaranteed that you will be notified of the suspend
*before* you wake up again. That is, you might not receive the
notification until after the device has been reawakened. Generally, you
should not be trying to react to suspend because of this limitation (and
the limitation on what you can do in response to the event, anyway).

You are absolutely right, IMO there is no too much reason to catch the
Suspend event
 
In my application, I need to be listening to the serial port round the
clock and be able to respond to the serial input data as they arrive.
However, when the device goes into suspend state, the serial port
objects become invalid. I think they must be closed and re-opened
before any data can be sent/received over the port again. For this I
need some sort of notification when the device wakes up from suspend
state.

Krupa
 
Wake up is not a problem, so the OpenNET CF stuff that Chris pointed you to
should be fine.

Paul T.
 
Back
Top