Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit
Delayed Startup
Delayed Startup
Another interesting option to start applications automatically is to leverage the services host process (Services.exe). Although Windows Embedded CE does not include a full-featured Service Control Manager (SCM), it does include built-in services and also comes with a sample service called Svcstart that can be used to start applications.
Svcstart is particularly useful for applications with dependencies on system components and services that are not immediately available after the startup process finishes. For example, it might take a few seconds to obtain an Internet Protocol (IP) address from a Dynamic Host Configuration Protocol (DHCP) server for a network interface card (NIC) or initialize a file system. To accommodate these scenarios, the Svcstart service supports a Delay parameter that specifies the time to wait before starting an application. You can find the Svcstart sample code in the %_WINCEROOT%PublicServersSDKSamplesServicesSvcstart folder. Compile the sample code into Svcstart.dll, add this DLL to your run-time image, and then run the sysgen -p servers svcstart command to register the Svcstart service with the operating system. Load it by using Services.exe.
Table 3-4 lists the registry settings that the Svcstart service supports to start applications.
Table 3-4 Svcstart registry parameters
Location | HKEY_LOCAL_MACHINESoftwareMicrosoftSvcstart1 |
---|---|
Application Path | @="iexplore.exe" |
Command-line Parameters | Args="-home" |
Delay Time | Delay=dword:4000 |
Description | Starts the application with the specified command-line parameters after a delay time defined in milliseconds. See the Svcstart.cpp file for more details. |
- Start an Application at Startup
- 5.2.2. Kernel Startup: main.c
- 6.3.2. Example Web Server Startup Script
- Assigning computer startup and shutdown scripts
- Recovering your server from hardware or startup failure
- 2.2.2 Startup
- Startup–скрипт
- The Startup Folder
- Overriding Debug Zones at Startup
- StartUp Entry Point and Main Function
- StartUp Entry Point
- 3.4.2.2 Making word abbreviations part of your startup