Starting an Application on an Event
The function CeRunAppAtEvent allows a program to be run when one of the following events occur:
NOTIFICATION_EVENT_SYNC_END. When data synchronization finishes.
NOTIFICATION_EVENT_DEVICE_CHANGE. When a PC Card device is changed.
NOTIFICATION_EVENT_RS232_DETECTED. When an RS232 connection is made.
NOTIFICATION_EVENT_TIME_CHANGE. When the system time is changed.
NOTIFICATION_EVENT_RESTORE_END. When a full device restore completes.
Listing 7.4 shows a call to CeRunAppAtEvent that sets Notify.exe to run when ActiveSync synchronization completes.
Listing 7.4. Runs application on an event
void Listing7_4() { if(!CeRunAppAtEvent(_T("\\Notify.exe"), NOTIFICATION_EVENT_SYNC_END)) cout ≪ _T("Cannot set application to run") ... |
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.