Problem with CeRunAppAtEvent (wake up event)

  • Thread starter Thread starter aucimen
  • Start date Start date
A

aucimen

I want to run an application on the wakeup event of the mobile device.
Its downloading a file over internet.but when i press the power button
to wake up the mobile device it cant connect to the server at that
time. it waits 10-15 seconds to connect. In that period my app runs
hundreds times.i want that my application runs one time at the wake
up.how can i control that?with a thread or anything else?

I am using CeRunAppAtEvent for this like following:
const int Wakeup = 0x00b;
private const int NOTIFICATION_EVENT_WAKEUP = 11;
[DllImport("coredll", EntryPoint="CeRunAppAtEvent", SetLastError=true)]

private static extern bool CeRunAppAtEvent(string AppName, int
WhichEvent);

then call in a function like:

public static void WakeUp()
{
bool rv;

try
{
rv = eRunAppAtEvent
"\\ProgramFiles\\download\\download.exe",NOTIFICATION_EVENT_WAKEUP);
}


catch
{
;
}
}

thanks for help!
 
Back
Top