Microsoft KB Archive/203746

= INFO: Command Line for Programs Launched from Init Key =

PSS ID Number: 203746

Article Last Modified on 10/29/2003

-

The information in this article applies to:


 * Microsoft Windows CE Embedded Toolkit for Visual C++ 5.0
 * Microsoft Windows CE Platform Builder 2.11
 * Microsoft Windows CE Platform Builder 2.12

-



This article was previously published under Q203746



SUMMARY
Programs launched at Windows CE startup from the [HKEY_LOCAL_MACHINE\Init] key of the registry receive the launch index ID as a parameter on the command line. This is the only command-line parameter available to programs launched from the Init registry key.



MORE INFORMATION
The index ID is the numeric portion of the "launch" label used to store the program name in the registry. For example, the following starts Taskman.exe with a command-line parameter of "50":   "launch50"="TASKMAN.EXE" Taskman.exe signals that it has completed its initialization by calling the SignalStarted function with the index value. The most common form of this is the following: SignalStarted(_wtol(lpCmdLine)); NOTE: lpCmdLine is the command-line pointer parameter passed to the WinMain program.

The SignalStarted function call allows any programs in the Init key that are dependent on Taskman.exe to be launched.

Programs that don't require any command-line parameters, or that require other OEM-specified command-line parameters, must be launched via a custom shell program. The shell program is launched from the Init key and uses the CreateProcess function to start the desired application.

