Knowledge Base

PRB: Registry-Based Notification and Command-Line Parameters

PSS ID Number: 196068

Article Last Modified on 10/2/2003


The information in this article applies to:


This article was previously published under Q196068

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: kbprb kbRegistry KB196068
Technology: kbAudDeveloper kbWin32API kbWin32sSearch