This content is provided AS IS for archive purposes only. Content may be out of date with no guarantee of correctness.

The Lnk Type - Lnk for Cobra - Static

Main Article

The Lnk Type - Lnk for Cobra

The lnk record exposes the following variables:

Type lnks = Record
 lPath             : String = ""               // Path of the original .lnk file
 lTargetPath       : String = ""               // Path of the shortcut target
 lRelativePath     : String = ""               // Relative path to the shortcut target
 lStartIn          : String = ""               // IGNORE - No Longer Used
 lDescription      : String = ""               // Description of the shortcut (comment/tooltip)
 lWorkingDir       : String = ""               // The working directory of the shortcut target
 lCustomIcon       : String = ""               // Path to custom icon
 lArguments        : String = ""               // Command Line arguments
 lIconIndex        : Integer = 0               // Custom Icon Index
 lFlag             : Array [7] of Boolean      // Array of flags about the shortcut file
 lAttribute        : Array [13] of Boolean     // Array of attribute flags
 lVolume           : Array [2] of Boolean      // Array of volume flags
 lVolumeType       : Integer = 0               // Volume type (CD, Removeable, etc)
 lVolumeSerial     : Integer = 0               // Volume serial number (may be invalid)
 lVolumeLabel      : String = "UNKNOWN"        // Volume label
 lShareName        : String = ""               // Network Share Name
 lShowWnd          : Integer = LNK_SWND_NORMAL // Show Window Mode (minimise, etc)
 lCreationTime     : Integer = 0               // IGNORE - Not yet read
 lModificationTime : Integer = 0               // IGNORE - Not yet read
 lLastAccessTime   : Integer = 0               // IGNORE - Not yet read
 lTargetFileSize   : Integer = 0               // File size of the target file
 lHotKey           : Integer = 0               // Shortcut Hotkey
EndType ; Export

The unit exports "lnk" as a pointer to lnks, which you can use without having to declare your own locally. For example:

Program
  Uses

      lnk

Begin
  lnk = ReadShortcut("My Shortcut.lnk")
  MessageBox(lnk.lTargetPath)
  Free(lnk)
End

Stay Subscribed

Follow me on twitter @golightlyb, subscribe to the RSS feed or get updates by e-mail.

You can also contact me directly - I make an effort to reply to every e-mail.


Login
v0.34.archive