Windows Embedded CE 6.0: How to Create Shortcuts

来源:互联网 发布:netbeans for php使用 编辑:程序博客网 时间:2024/05/30 23:33

原文地址

Mike Hall
When you boot a Windows CEoperating system image that uses the Standard Shell (the shell thatlooks similar to the Windows Shell, most commonly experienced as theWindows Desktop) you will notice shortcuts to Internet Explorer and theImage Viewer on the desktop. Perhaps, when creating your own operatingsystem image, you might want to create your own shortcuts.

Bydefault, all applications and files are mapped to the \Windows folder.Shortcuts take very little space (as you will see in a moment), and canalso include command line parameters (more on that in a moment).Shortcut files are simply text files that can be created and editedusing your favorite text editing application.

Let's take asimple example to start, an application that no self-respectingoperating system should be without ... Solitaire! Shortcuts have thefile extension .lnk, so the shortcut file is going to be Solitare.lnk,and would contain the following:

21#\Windows\solitare.exe

So,how does this work? In the code, 21# tells us that the command linecontains 21 characters and that the command line is\Windows\Solitare.exe (which is 21 characters, count them!)

Now,let's take a look at a slightly more elaborate example, (but it's alsovery simple!) This example is the Internet Explorer shortcut file,iesample.lnk. Here's the content of the file:27#\Windows\iexplore.exe-homeThe command line, including the optional parameter -home is 27characters. Notice that the Internet Explorer shortcut contains notonly the location of the program, but also includes the -home commandline. This instructs Internet Explorer to open at the home page. But,wait a second. On the desktop, the shortcut appears as InternetExplorer, not as a shortcut to Iesample. When the Windows CE operatingsystem gets built, we can examine the contents of the overall operatingsystem .dat file, initobj.dat (the .dat file contains the creation offolders and maps files to folders). Here's the interesting line fromthe .dat file:
Directory("\Windows\Desktop"):-File("Internet Explorer.lnk", "\Windows\iesample.lnk")
Noticehow the actual file, \Windows\iesample.lnk, maps to the\Windows\Desktop folder and appears as Internet Explorer.lnk on thedesktop. The .dat file entries can be used to map and rename files,pretty cool, eh?

So, there we have it, how to create shortcuts.The next (simple) step would be to add the .lnk file to the operatingsystem image (perhaps using CEFileWiz) and map the file to a folderother than the \Windows folder.

Mike Hall is a TechnicalProduct Manager in the Windows Embedded Product Group. To get moreinsights into Windows Embedded, read his blog.


原创粉丝点击