|
'Windows API/Global Declarations for :MakeIcons
'*********************************************** Private Declare Function fCreateShellLink Lib _ "vb6stkit.dll" (ByVal lpstrFolderName As String, _ ByVal lpstrLinkName As String, _ ByVal lpstrLinkPath As String, _ ByVal lpstrLinkArgs As String, _ ByVal fPrivate As Integer, _ ByVal sParent As String) As Long Public Function CreateIcon(IconTitle As String, _ ProgramPath As String, _ Optional PutWhere As Integer = 0) As Boolean On Error Goto ErrorHandler Select Case PutWhere Case 0 'desktop fCreateShellLink "..\..\Desktop", IconTitle,_ ProgramPath, "", -1,"$(Programs)" CreateIcon = True Case 1 'StartMenu/Programs fCreateShellLink "..\Programs", IconTitle, _ ProgramPath, "", -1,"$(Programs)" CreateIcon = True Case 2 'StartMenu fCreateShellLink "..", IconTitle, ProgramPath, _ "", -1,"$(Programs)" CreateIcon = True Case 3 'StartMenu/Programs/Startup 'will auto run at startup fCreateShellLink "..\Programs\StartUp", _ IconTitle, ProgramPath, "", -1, _ "$(Programs)" CreateIcon = True Case Else 'invalid call Get out CreateIcon = False End Select ErrorHandler: CreateIcon = False End Function |