Problem with CeRunAppAtEvent (wake up event)

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!
 

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