Reputation:
I have been at this thing for a couple of days and I just can't see CeRunAppAtTime working. I just want to ask if anyone has ever got his to work?
Could anyone please post a working code sample?
Upvotes: 3
Views: 1562
Reputation: 29009
If you'd have a look into the notify.h, where CeRunAppAtTime is defined, you might notice it is obsolete and not supported:
//
//Obsolete; provided to maintain compatibility only
//
HANDLE CeSetUserNotification (HANDLE hNotification,
TCHAR *pwszAppName,
SYSTEMTIME *lpTime,
PCE_USER_NOTIFICATION
lpUserNotification);
BOOL CeRunAppAtTime (TCHAR *pwszAppName, SYSTEMTIME *lpTime);
BOOL CeRunAppAtEvent(TCHAR *pwszAppName, LONG lWhichEvent);
BOOL CeHandleAppNotifications (TCHAR *pwszAppName);
It might work, even most of the time, but you are on your own there.
It is recommended to use CeSetUserNotificationEx instead.
Upvotes: 2
Reputation: 11750
It seems that the device must be set to a full power-on state after your app is launched, or it goes back to "sleep". You can accomplish this through a call to SetSystemPowerState, as detailed here
Upvotes: 0
Reputation: 12485
CeRunAppAtTime does work, but unfortunately it seems to be rather platform dependant. On some devices, it's extremely unreliable. You can use CeSetUserNotificationEx to accomplish the same thing. I've found it much more reliable on newer devices, but on some devices it too just doesn't work well. I don't know what's so hard about this particular task, but many OEMs just can't seem to get it right.
Upvotes: 1