Registry-based Notification (Windows CE 5.0)

Send Feedback

Registry-based notification is based on two predefined events, AutoStartOnConnect and AutoStartOnDisconnect, each of which has its own registry key. When either event occurs, a command associated with the corresponding key is executed.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnDisconnect

To associate an application with an event

  1. Construct a value that uniquely identifies the application.

    The value should include a company and product name — MicrosoftActiveSync, for example.

  2. Enter the identifier value under one or both AutoStartOn registry keys.

  3. The data for the identifier should be the command line for the application to be executed, including arguments. The command line must be enclosed in quotation marks if arguments are used.

The following registry editor (.reg) file shows how to register a command line for both AutoStartOnConnect and AutoStartOnDisconnect. When the Windows CE-based device is connected, Notepad is started with a command-line argument of C:\Config.sys. When the Windows CE-based device is disconnected, Notepad is started with a command-line argument of C:\Autoexec.bat.

REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect]
    "MicrosoftActiveSync"="\"notepad"\ c:\\config.sys"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnDisconnect]
    "MicrosoftActiveSync"="\"notepad"\ c:\\autoexec.bat"

See Also

Handling Connection Notification

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.