blue123
驱动中牛
驱动中牛
  • 注册日期2002-11-09
  • 最后登录2009-09-14
  • 粉丝0
  • 关注0
  • 积分91分
  • 威望11点
  • 贡献值0点
  • 好评度10点
  • 原创分0分
  • 专家分0分
阅读:998回复:1

快捷方式

楼主#
更多 发布于:2003-02-16 18:10
在PB中开发的程序
为什么便宜以后都在 WINDOWS 目录中?

能不能更换一个目录
或者在桌面创建一个快捷方式。

如果创建快捷方式的话?
是不是要做一个 .lnk 文件

那么 .lnk文件怎么制作呢?
努力!
leo_cyl
驱动牛犊
驱动牛犊
  • 注册日期2001-08-20
  • 最后登录2009-11-02
  • 粉丝0
  • 关注0
  • 积分22分
  • 威望13点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2003-02-17 11:37
拜托先看一下HELP!!!!!
以下出自PB HELP:


A file system (.dat) file defines the directory and file locations for the initial settings on a target device. When you cold boot your platform on the target device, Filesys.exe uses these .dat files to create the directories, links, and files in the RAM file system on the target device.

When updating the Project.dat file to define directory and file locations, you can specify any root directory name other than the Windows directory and its subdirectories. In addition, you can copy or link to a file in the ROM Windows directory. The file or link is created in the RAM file system that is part of the object store in the directory specified by the .dat file.

The following code example shows typical entries in a Project.dat file.

root:-Directory(\"My Documents\")
root:-Directory(\"Program Files\")
Directory(\"\\Program Files\"):-Directory(\"My Projects\")
Directory(\"\\Program Files\"):-Directory(\"Accessories\")
Directory(\"\\Program Files\"):-Directory(\"Communication\")
Directory(\"\\Program Files\\My Projects\"):-File(\"My Project Program\", \"\\Windows\\Myproj.exe\")
root:-File(\"\\control.lnk\", \"\\Windows\\control.lnk\")
The root: statement defines the root directories for the OS image. The root: statement is used to create any subdirectories that must be the first entry in the file. Two directories, My Documents and Program Files, are located below the root directory. In addition, three subdirectories ― My Projects, Accessories, and Communication ― are located in the Program Files directory. The -File parameter copies the file Myproj.exe from ROM, as defined by the Windows directory, into the My Projects directory with the My Project Program file name.

When updating the .dat files, you can use IF and ENDIF conditional blocks and, optionally, the NOT (!) operator. Use the semicolon (;) to start a line of comments. The following code example shows how the subdirectory locations for the Program Files directory could be rewritten.

IF IMGINCLUDEAPPS
  Directory(\"\\Program Files\"):-Directory(\"My Projects\")
ENDIF
IF IMGNOACC !
  Directory(\"\\Program Files\"):-Directory(\"Accessories\")
ENDIF
Directory(\"\\Program Files\"):-Directory(\"Communication\")
In this example, Makeimg.exe includes the My Projects directory if the user-defined environment variable IMGINCLUDEAPPS has been set before running Makeimg.exe. If the environment variable IMGNOACC was not set, the Accessories directory is included. Regardless of environment variable settings, the Communication directory is included in the OS image.

Items placed in the ROM image appear in the \\Windows directory automatically. At boot time, the OS parses the information that was in the .dat file and creates a more robust file system by creating other directories and copying files to their appropriate locations. This uses RAM to store the files that were copied. Items listed in the .dat file are then copied, not moved. .lnk files make up the majority of the items in the .dat file because .lnk files are very small, as they are shortcut files, not symbolic links. The .dat file is the only way to make a file appear in outside the \\Windows directory.

To add a desktop shortcut using a link to MyApp.exe

Create the .lnk file.
A .lnk file is a text file that contains the command line for the linked target, which may be enclosed in double quotation marks, along with the length of that command line. Optionally, you can also pass parameters into the linked target. This is behavior that may be changed if the shortcut module is replaced in Coredll, however.

By default, a .lnk file uses the following format.

[number of ASCII characters after pound sign]#[command line] [optional parameters]
For example, to start MyApp.exe and pass two optional parameters into the application, a sample MyApp.lnk file contains the following.

40#\\Windows\\MyApp.exe parameter1 parameter2
The .lnk file should be placed in the \\Public\\<project>\\WinCE410\\Oak\\Files folder.

Create an entry in the .dat file to move the link.
Because the Windows CE-based ROM image places all ROM files into the \\Windows folder by default, these files must be moved to other locations at system boot. The .dat file controls how the files are copied.

Place the following line in the Project.dat file (located in \\Public\\<project>\\WinCE410\\Oak\\Files) to copy MyApp.lnk to the desktop.
Directory(\"\\Windows\\ <LOC_DESKTOP_DIR> \"):-File(\"MyApp.lnk\", \"\\Windows\\MyApp.lnk\")
Add the .lnk file to the ROM image. The .lnk file must be included in the files stored in the ROM image. Edit the Project.bib file and add the following line in the section for FILES.
MyApp.LNK $(_FLATRELEASEDIR)\\MyApp.LNK NK S
游客

返回顶部