Suspend event in Win CE

K

Krupa

Hi,

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

Thanks,
Krupa
 
I

Ignacio Machin \( .NET/ C# MVP \)

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)
 
K

Krupa

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
 
P

Paul G. Tobey [eMVP]

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.
 
I

Ignacio Machin \( .NET/ C# MVP \)

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
 
K

Krupa

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
 
P

Paul G. Tobey [eMVP]

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

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top