Automatically run programs on Windows CE

Source: Internet
Author: User

How to configure the Registry to run an application at startupYou can add an application to your OS design and then configure the Registry to run the application when your run-time image boots. by doing so, you can decrease the amount of time involved in debugging an application. otherwise, after your run-time image boots, you must manually load and run the application on your target device. NoteThis procedure requires you to have already created an application. for information about creating and building an application in the context of using platform builder with a cepc, see Tutorial: Building a run-time image for a cepc. to track your progress, select the check box next to each step.
  Step Topic
1. Open an existing OS design, or create a new one, and then build and download the run-time image to a target device. How to Use the IDE to create, customize, and build a Run-Time Image
2. Use the Remote Registry Editor to discoverHKEY_LOCAL_MACHINE/initLaunch numbers for each. EXE file that runs on the target device at startup. To run your application at startup, assign launch numbers to your application's. EXE files inHKEY_LOCAL_MACHINE/initSection of the Registry of the target device.
  • Connect to your target device using the Remote Registry Editor.
If the connection fails, see connecting ing the connection to a target device using platform manager.
  • InWindows CE Remote Registry EditorWindow, expandDefault DeviceNode, thenHKEY_LOCAL_MACHINENode, and thenInitNode.
  • In the right pane, inNameColumn, note the launch number for each application.
These numbers use the launchNnFormat, whereNnIs the launch number.
Opening Remote Registry Editor connecting to a target device with a remote Tool
3. Add the application to your OS design as a project. Adding an existing project to an OS design
4. Create a registry entry inHKEY_LOCAL_MACHINE/initSection of the Project. reg file for your application. Refreshing a registry file to run an application at startup
5. Build the changed catalog items in your OS design. Building a run-time image building a selected project
6. configure a connection between your development workstation and your target device.NoteDebugging is not necessary at this point. if your target device is a cepc, boot your run-time image on the cepc. for more information, see how to configure and download a run-time image to a cepc. if your target device is the emulator, download your run-time image to the emulator. for more information, see downloading a run-time image to the emulator. Refreshing a connection for downloading and debugging
7. When the download process is complete, verify that the application launched properly on your target device. The time required to display the OS depends on the size of the downloaded run-time image. Not applicable
Refreshing a registry file to run an application at startupYou can configure a registry (. Reg) file to run a module when your run-time image starts up. There are two ways to configure registry files:
  • Modify the Registry file before building and downloading the run-time image.
  • Use the Remote Registry Editor after downloading the run-time image to the device.
Using the Remote Registry Editor changes the run-time image registry, but the changes are not persisted to the registry files in platform builder. the next time you download the run-time image, you must configure the Registry again. for more information, see Remote Registry Editor. To modify a registry file in the IDE
  1. FromWorkspaceWindow, chooseParameterviewTab at the bottom of the window.
  2. Expand the nodes until you find the folder for the target device you have chosen.
For example, if you create an OS design for the emulator, find EmulatorFolder.
  1. Expand the folder and then expandProject specific filesFolder.
  2. 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.
  1. Update or addHKEY_LOCAL_MACHINE/initSection of the Registry file with the following code.
6.     [HKEY_LOCAL_MACHINE/Init]
7.     "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 HKEY_LOCAL_MACHINE/initSection of the Registry file.
Parameter Description
LaunchNn Defines the order that the module is started in, whereNnIs 00-99. enclose this parameter in double quotation marks ("").
Defined_module_name Specifies the name of the module to be started. enclose this parameter in double quotation marks ("").
DependNn Optional. assigns a dependency that prevents the defined module from starting until another module is started, whereNnIs 00-99. enclose this parameter in double quotation marks ("").
HEX:XX, YY... Defines the hexadecimal number of the module that must be run before the defined module is run. This parameter consists ofHEXKeyword, a colon, and one or more hexadecimal numbers, one for each byte of hexadecimal data.
After your run-time image calla module using InitRegistry value, the application must call the signalstarted function. SignalstartedIndicates that the module is ready for the rest of the OS to continue processing. The value passed as the parameter SignalstartedIs the value passed on the command line of the module started from InitKey.
  1. 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 assumer.exe.
[HKEY_LOCAL_MACHINE/Init]
"launchnn"="defined_exe_name"
"dependnn"=hex:0A,00,14,00,1E,00,32,00
  1. Save and close the registry file.

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

The above method is implemented by modifying the Registry in red. It may be inconvenient for users. can we enable Windows CE to automatically run the. EXE file under a directory on flash diskafter it is started? See the following:

In the Windows directory of Windows CE, there is a Startup Folder. After Windows CE is started, Windows CE automatically runs all the files in this folder. EXE file, but all contents in this directory will be lost after power-off, or cannot be automatically run after power-on. Can we change this directory to a directory on flash disk, the answer is yes, and it is very easy. We only need to modify the registry.

[HKEY_LOCAL_MACHINE/system/Explorer/Shell Folders]

"Startup" = "flash disk // startup"

In this way, after Windows CE is started, all. EXE files under the flash disk/startup directory will be run.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.