|
||
|
Creating Shortcuts using VBThis article expands on the cShellLink class provided to allow the shortcuts used in Window's Recent Document Collection to be investigated. It demonstrates how to use the class to read and write shortcuts, including choosing the icon, start up directory and more. Using the ShellLink ClassA shortcut in Windows has a number of properties, most of which are optional:
The cShellLink class provided with the download provides a straightforward wrapper around each of these properties. Once you've created an instance of the object, you can use the Resolve method to load an existing shortcut, or just start modifying the properties for a new one. The Target, IconPath and IconIndex, Arguments, WorkingDirectory, Description, DisplayMode and HotKey properties then provide read/write access to the shortcut's details. To get a StdPicture containing the icon, use the Icon property: note that as the icon details are optional, the icon may just be the Shell's icon associated with the target, in which case you can use the File Icon class to get it. To make the sample more usable, I've included the Icon Picker control for choosing icons for the shortcut.
|
|
|