Running an Application at a Specified Time

The function CeRunAppAtTime sets an application to be run at a time specified in a SYSTEMTIME structure. Listing 7.1 shows how this function can be called to run Pocket Word at 7.20AM on the current day. Note that the file notify.h must be included when using notification functions. The code gets the current local time through calling GetLocalTime, and sets the hour to 7 and minute to 20. The call to CeRunAppAtTime is passed the name of the application to run and the time to run it.

Listing 7.1. Runs an application at a specified time
 #include <notify.h> void Listing7_1() { SYSTEMTIME sysTime; GetLocalTime(&sysTime); sysTime.wHour = 7; sysTime.wMinute = 20; if(!CeRunAppAtTime( _T("\\Windows\\Pword.exe"), ...

Get Windows® CE 3.0 Application Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.