Bruce Eitman

Windows CE Musings

  Home  |   Contact  |   Syndication    |   Login
  107 Posts | 0 Stories | 116 Comments | 0 Trackbacks

News

Tag Cloud


Archives

Post Categories

You have developed or bought a Windows CE system and developed an Application for it. Now you want to start your application every time the system boots up. Not an unusual need, but the solution will have a lot to do with who you are and what you have to work with.
So, who are you?
Platform Builder User
Since you are using Platform Builder, you have access to the system registry so you can use the HKEY_LOCAL_MACHINE\Init key to start your application. FileSys uses HKEY_LOCAL_MACHINE\Init to find which applications to start when the system boots. The values are LaunchXX and DependXX, where the XX are numbers; example Launche60 and Depend60. This is the same registry key that is used to start applications like the device manager, the services manager and the Explorer shell.
LaunchXX is a string value. Pick a number, one that makes sense within the context of your system, and set the value of LaunchXX to the name of your application; Example Launch60=”MyApp.exe”.   You cannot use this string to pass command line arguments to your application. If you need to pass command line arguments, you should create a small wrapper application that calls on your application and passes arguments to it.
DependXX is a hex value. The XX number must match the number that you used for LaunchXX. The value indicates which of the LaunchXX applications your application is dependent on. "Depend60"=hex:14,00, 1e,00 indicates that the application is dependent on Launch20 (0x14 == 20) and Launch30 (0x1e == 30).
If you use HKEY_LOCAL_MACHINE\Init to start your application, you should call SignalStarted() to tell the system that your application is running and ready. Failure to call SignalStarted() can cause other applications to not be started.
Visual Studio User\End User
If you are not developing the Windows CE OS for your platform, you can add your application to the \Windows\Startup folder. This option does require that the \Windows\Startup folder is persistent and that the Explorer shell runs on your system.
You do have as an option the previous discussion for Platform Builder users, if the registry is persistent.
Using a Proprietary System
If you are using a COTS system, the OEM may have a proprietary way for you to start your application.
posted on Monday, June 30, 2008 11:35 PM

Feedback

# re: Windows CE: Starting an Application when the System Boots 7/1/2008 11:45 AM Chris Tacke
It's probably worth noting here that if you launch you application via HKLM\Init, then your app *will* get a command line. It will be the "Launch" number you've assigned (so if your app is set in Launch60, your app will get a command line of "60". It is this number that you must convert from a string to a DWORD and pass in to SignalStarted.

# re: Windows CE: Starting an Application when the System Boots 7/1/2008 7:33 PM Bruce Eitman
Right, and for a simple example of using the command line and call SignalStarted, see http://geekswithblogs.net/BruceEitman/archive/2008/06/13/windows-ce-monitoring-for-disk-insertion-to-add-support-for.aspx

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 4 and 8 and type the answer here: