Automatically run the application when the wince system starts.

Source: Internet
Author: User

Ugg boots
Ugg boots cheap
Ugg boots sale
Ugg boots Outlet

I. shortcuts

Assume that the target project of Windows CE. NET is of the cepc type, and the directory is E:/project/mywince,
And the project has been built (or rebuild) successfully;

Assume that the application of Windows ce.netis myapp.exe.


1. Copy myapp.exe to the E:/projects/mywince/reldir/cepc_x86release directory;


2. Modify the project. bib file of the mywince project and add

Myapp.exe $ (_ flatreleasedir)/myapp.exe nk h


3. Create the shortcut file MyApp. lnk (text file). The content of the file is as follows:

10 #/Windows/myapp.exe
MyApp
The. lnk file is also stored in the E:/projects/mywince/reldir/cepc_x86release directory.


4. Modify the project. bib file of the mywince project and add

MyApp. lnk $ (_ flatreleasedir)/MyApp. lnk nk h


5. Modify the project. dat file of the mywince project and add the following content:

Directory ("/Windows/startup"):-file ("MyApp. lnk", "/Windows/MyApp. lnk ")


6. Platform builder ide-> menu build-> makeimage (do not build or rebuild,
Otherwise, you will try again)

The obtained nk.binincludes the application myapp.exe and MyApp. lnk,
And the MyApp program runs automatically when the system starts.


Note:

I. There are two methods to package custom files into NK. Bin:


One is to edit the project. bib file.

In the files section, describe the file name, path of the source file,
File attributes in the target system. Above,
Myapp.exe $ (_ flatreleasedir)/myapp.exe nk h
Indicates
Package the myapp.exe file in the E:/project/mywince/reldir/cepc_x86releasedirectory into NK. Bin,
The file is located in the kernel memory zone, and the file property type is hidden.

The second method is to add user feature.


Platformbuilder ide-> featureview-> right click on "mywince features"->
Insert user feature-> point to the file to be packaged.

Regardless of the packaging method,
All files are in the/Windows directory. The next step is to reorganize the directory structure of the file system as needed.


II. To organize the directory structure of a file system, modify the project. dat file and add the description of the file directory structure.
The description syntax is as follows:

Root:-directory ("<Directory Name>") indicates creating a directory under the root directory (/)

Directory ("/<Directory Name>"):-directory ("<subdirectory Name>") indicates creating a subdirectory under the specified directory

Directory ("/(" <Directory Name>/<subdirectory Name> "):-file (" <File Name>. <extension> ","/Windows/<File Name>. <extension> ")
Indicates the creation of files in the specified directory or the copy of files in the Windows directory. The display name is <File Name>. <extension>.
(Do you remember that the package file is in the/Windows directory? Haha, I think you understand)


Iii. applications do not have to be packaged into NK. Bin.

Assuming that the program is in a certain position on the hard disk,
For example,/Hard Disk/MyApp/myapp.exe, you only need to create a shortcut file and direct the link to/Hard Disk/MyApp/myapp.exe.


Iv. Related pb42 Help topics

Adding a file to an operating system
Creating a shortcut file
And adding it to the OS
Organizing files within an OS
In simple terms,
Find out which directory the application will appear, create the correct shortcut file, and modify the directory organization configuration of the target system,
Finally, package the application and the corresponding shortcut file into NK. Bin.

Ii. Registry

1. Configure project. bib or
Add User feature to include <your program> into NK. Bin
See "enable the program to run automatically when the Windows CE system is started"
-Shortcuts

2. Configure platform. Reg or common. Reg, and add the following in the [HKEY_LOCAL_MACHINE/init] section:
Content:

"Launchxx" = "<your program>"
"Dependxx" = HEX: yy, ZZ ,...
XX is a decimal number,
Indicates the startup sequence identifier of <your program>. yy, ZZ is the hexadecimal number of least significant, indicating <your program>
The startup sequence ID of the dependent Program (prior to <your program> running.

For example:
"Launch80" = "myapp.exe"
"Depend80" = HEX: 1E, 00
Indicates the startup sequence ID of the program myapp.exe.
Is 80, which depends on the program identified as 30 (that is, 001e.
If <your program> does not depend on other programs, you do not need to add
"Dependxx" = HEX: yy, ZZ,... indication;
If <your program> depends on multiple programs, specify in the "dependxx" instruction;

Eg.
"Launch80" = "myapp.exe"
"Depend80" = HEX: 0a, 00, 1e, 00
It indicates the startup dependency of the myapp.exe program.
Programs identified as 10 and 30.

3. platformbuilder ide-> build-> makeimage to generate a new NK. Bin

Note:


1. If <your program> is the program on which other programs depend, add the following code to the <your program> code:

Signalstarted (XX );
To notify the operating system that <your program> is running, otherwise the program dependent on <your program> will not run.

Generally, signalstarted is added before the final (mfc ce) or while (getmessage (...) of the initinstance member function.
(C sdk)

2. Do not repeat the startup sequence identifier. the startup sequence identifier of the dependent program should be greater than that of the dependent program.


3. If you do not want your program to be included in NK. Bin and want it to be automatically started, clearly state
Path, and ensure that the file system driver runs first.
Eg.
"Launch80" = "/Hard Disk/MyApp/myapp.exe"

"Depend80" = HEX :...

4. <your program> startup failure does not affect the system

 
5. Refer to "enable programs to run automatically when Windows CE is started-shortcut"

 
6. Related pb4.2 help topic adding a file to an operating system how to configure the Registry to run an application at startup.

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.