Share via


Configuring a Registry File to Run an Application at Startup

You can configure a registry file (.reg) to run a module when your platform starts up. There are two ways to configure registry files:

  • Modify the registry file before building and downloading the operating system (OS) image.

    - or -

  • Use the Remote Registry Editor after downloading the OS image to the device.

    Using the Remote Registry Editor changes the OS image registry, but the changes are not persistent to the registry files in Platform Builder. The next time you download the OS image, you must configure the registry again. For more information, see Remote Registry Editor.

To modify a registry file in the IDE

  1. From the Workspace window, choose the ParameterView tab at the bottom of the window.

  2. Expand the nodes until you find the folder for the target device configuration that you have chosen.

    For example, if you have created a configuration for the Emulator, find the Emulator folder.

  3. Expand the folder, and then expand the Project Specific Files folder.

  4. Select and open the appropriate registry file.

    Typically, this is the Project.reg file. Settings in Project.reg override other registry settings due to the order in which the build system processes the registry files.

  5. Update or add the HKEY_LOCAL_MACHINE\Init section of the registry file with the following code.

    [HKEY_LOCAL_MACHINE\Init]
    "launchnn"="defined_module_name"
    "dependnn"=hex:xx,yy...
    

    The following table shows descriptions of the parameters in the code you must update or add to the HKEY_LOCAL_MACHINE\Init section of the registry file.

    Parameter Description
    launchnn Defines the order that the module is started in, where nn is 00–99. This parameter must be enclosed in double quotation marks (" ").
    defined_module_name Specifies the name of the module to be started. This parameter must be enclosed in double quotation marks (" ").
    dependnn Assigns a dependency that prevents the defined module from starting until another module is started, where nn is 00–99. This parameter must be enclosed in double quotation marks (" "). This parameter is optional.
    hex:xx,yy... Defines the hexadecimal number of the module that must be run before the defined module is run. This parameter consists of the hex keyword, a colon, and one or more hexadecimal numbers, one for each byte of hexadecimal data.

    After your platform calls a module using the Init registry value, the application must call the SignalStarted function. SignalStarted indicates that the module is ready for the rest of the OS to continue processing. The value that is passed as the parameter to SignalStarted is the value passed on the command line of the module started from the Init key.

  6. If you do not know the hexadecimal numbers for the module dependencies that your application requires, open and search Common.reg for the module names.

    The following code example shows how to set your module to depend on the standard initialization modules, which include Filesys.exe, Gwes.exe, Device.exe, and Explorer.exe.

    [HKEY_LOCAL_MACHINE\Init]
    "launchnn"="defined_exe_name"
    "dependnn"=hex:0A,00,14,00,1E,00,32,00
    
  7. Save and close the registry file.

You have successfully modified a registry file to run a module at startup.

See Also

How to Configure the Registry to Run an Application at Startup | Registry | Remote Registry Editor | Using the Remote Registry Editor

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.