PRB: Registry-Based Notification and Command-Line Parameters

ID: Q196068

The information in this article applies to:

SYMPTOMS

During the connection or disconnection of a Windows CE Device with the desktop, a desktop application can be executed based on the occurrence of either event. The information to make this happen is stored in the registry keys AutoStartOnConnect and AutoStartOnDisconnect, which are subkeys of the Windows CE Services key:

   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services

To enable Windows CE Services to launch an application based on either event, you can create a REG_SZ value that specifies the application. Sometimes, you may want to launch an application with command-line parameters. This action may fail with a message box titled, "Application Failed to Start."

CAUSE

Windows CE Services 2.x implements the launching of an application via the ShellExecute API.

RESOLUTION

If the exe path is surrounded by quotation marks, the ShellExecute API will recognize any trailing command-line parameters instead of interpreting the entire contents as the exe path; for example:

   "c:\winnt\system32\notepad.exe" c:\test.txt

STATUS

This behavior is by design.

REFERENCES

For more information on Registry-based connection notifications, please refer to the Windows CE Platform SDK documentation.

Additional query words: messagebox

Keywords          : kbKernBase kbRegistry kbWinCE kbWinCE200 
Version           : WINNT:
Platform          : winnt
Issue type        : kbprb

Last Reviewed: November 21, 1998