V.3.1
clsShellLink

This class permits you to manage Unicode Shell links:

Properties:
Arguments The link arguments (get/let)
Description The link description (get/let)
HotKey The link HotKey (get/let)
Icon The link icon

When reading this property a Picture will be returned
When setting this property you can use:
a) a String for specifying a filename
b) a Numeric for specifying an icon index for the currect Target
LnkPath The source .lnk path
ShowCommand The link window style (get/let)
Target The link target (this is the file/folder pointed by the link - get/let)
WorkingDirectory The link working directory (get/let)
Methods:
Destroy Clean the object content
Load Loads a certain .lnk file from disk and permits to read its information using the above properties
Save Saves a .lnk file to disk using the above properties
Samples

Load info from a link:


   Dim oLink As clsShellLink
   Set oLink = New clsShellLink
   
   Dim sText As String
   Dim s as String    
   s=App.Path & "\a.lnk"

   'txt is an Unicode TextBox

   If s <> "" Then
       If oUniFile.st_FileExist(s) Then
           oLink.Load s
           
           sText = "Target: " & oLink.Target & vbNewLine & _
               "Arguments: " & oLink.Arguments & vbNewLine & _
               "Description: " & oLink.Description & vbNewLine & _
               "Working Directory: " & oLink.WorkingDirectory
           
           txt.Text = sText
       
       End If
   End If

Save a .lnk file:

   Dim oLink As New clsShellLink
   oLink.LnkPath = App.Path & "\my.lnk"
   oLink.Target = "notepad.exe"
   oLink.Description = "My Link ;-)"
   oLink.Icon = Me.Icon
   oLink.Save
http://www.hexagora.com
Thu, 22 Sep 2011 17:54:35 UT
Copyright 2003-11 by Lorenzi Davide