Posted: Sat Aug 24, 2002 8:25 am
Restored from previous forum. Originally posted by ricardo.
Iv tried the code founded on Paul's site and dosent works for XP
Then i check this code for vb
Declare Function fCreateShellLink Lib "VB5STKIT.DLL" ( _
ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, _
ByVal lpstrLinkArgs As String) As Long
Dim x As Long
x = fCreateShellLink("..\..\Desktop", "My Link", _
"C:\MyFolder\Program.Exe", "")
(http://spazioinwind.libero.it/vbprogzon ... ip020.html
http://spazioinwind.libero.it/vbprogzon ... ip037.html)
My code:
If OpenLibrary(0, "c:\windows\system32\vb5stkit.dll")
Result = IsFunction(0, "fCreateShellLink")
If Result
Result.l = CallFunction("c:\windows\system32\vb5stkit.dll","fCreateShellLink","..\..\Desktop","Testing","c:\windows\notepad.exe",0)
MessageRequester("",Str(Result),0)
EndIf
EndIf
CloseLibrary(0)
But its crashes always.
What im doing wrong?
This API let create shortcuts on any folder
Iv tried the code founded on Paul's site and dosent works for XP
Then i check this code for vb
Declare Function fCreateShellLink Lib "VB5STKIT.DLL" ( _
ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, _
ByVal lpstrLinkArgs As String) As Long
Dim x As Long
x = fCreateShellLink("..\..\Desktop", "My Link", _
"C:\MyFolder\Program.Exe", "")
(http://spazioinwind.libero.it/vbprogzon ... ip020.html
http://spazioinwind.libero.it/vbprogzon ... ip037.html)
My code:
If OpenLibrary(0, "c:\windows\system32\vb5stkit.dll")
Result = IsFunction(0, "fCreateShellLink")
If Result
Result.l = CallFunction("c:\windows\system32\vb5stkit.dll","fCreateShellLink","..\..\Desktop","Testing","c:\windows\notepad.exe",0)
MessageRequester("",Str(Result),0)
EndIf
EndIf
CloseLibrary(0)
But its crashes always.
What im doing wrong?
This API let create shortcuts on any folder