Dipesh A.


I have an netcf 2.0 application which does an action periodically. My problem is I want to do carry out some logic from within the app as soon as the device wakes up.

How can I detect wake up events in .net cf I dont want to use opennetcf for now.

Re: Smart Devices VB and C# Projects Detecting device wake up event within the running application.

Guang-Ming Bian - MSFT

Hi Dipesh A,

You can use CeRunAppAtEvent method to register an event when device wake up. Although it is an API, you can P/Invoke it using c#,

Like the below code:

Code Block
<DllImport("coredll.dll", SetLastError:=True)> _
Private Shared Function CeRunAppAtEvent(ByVal appName As String, _
ByVal whichEvent As ceEvents) As Boolean
End Function

A sample in CodeProject:


For more CeRunAppAtEvent information:


Best regards,

Guang-Ming Bian - MSFT