Unicode Controls & Classes for VB6 - Version 4

clsShellLink Class

This class permits you to manage Unicode Shell links

Name Description
Name Description
Name Type Description
Arguments (String) Gets or sets the Link arguments
Description (String) Gets or sets the Link description
HotKey (KeyCodeConstants) Gets or sets the Link hotkey
Icon (Variant) Gets or sets the Link Icon; returns the Icon handle (in a Picture object) associated with the link
LnkPath (String) Gets or sets the Path of the link file
ShowCommand (VbAppWinStyle) Gets or sets the Link window style
Target (String) Gets or sets the link target (the file/folder pointed by the link)
WorkingDirectory (String) Gets or sets the Link working folder
Name Type Description
Destroy Releases resources used by the class
Load Loads a certain .lnk file from disk and permits you to read its information using the above properties
Save Saves a .lnk file to disk using the above properties
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