|
-
Jun 1st, 2007, 08:57 PM
#1
Thread Starter
Addicted Member
-
Jun 1st, 2007, 09:21 PM
#2
Addicted Member
Re: How to Read and Write Shortcuts
This api for create & delete shortcut example source code:
Code:
Private Declare Function OSfCreateShellGroup Lib "Vb5stkit.dll" Alias "fCreateShellFolder" (ByVal lpstrDirName As String) As Long
Private Declare Function OSfCreateShellLink Lib "Vb5stkit.dll" Alias "fCreateShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArguments As String) As Long
Private Declare Function OSfRemoveShellLink Lib "Vb5stkit.dll" Alias "fRemoveShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String) As Long
Dim lresult As Long
Private Sub CmdAdd1_Click()
Dim lresult As Long
lresult = OSfCreateShellGroup("Test")
End Sub
Private Sub CmdDel_Click()
Dim lresult As Long
lresult = OSfRemoveShellLink("..\..\start menu", "Notepad")
lresult = OSfRemoveShellLink("..\..\desktop", "Notepad")
lresult = OSfRemoveShellLink("Test", "Notepad")
End Sub
Private Sub CmdAdd2_Click()
Dim lresult As Long
lresult = OSfCreateShellLink("..\..\desktop", "Notepad", "c:\Windows\notepad.exe", "")
End Sub
Private Sub CmdAdd4_Click()
lresult = OSfCreateShellLink("test", "Notepad", "c:\Windows\notepad.exe", "")
End Sub
Private Sub CmdAdd3_Click()
lresult = OSfCreateShellLink("..\..\start menu", "Notepad", "c:\Windows\notepad.exe", "")
End Sub
-
Jun 2nd, 2007, 09:43 AM
#3
Thread Starter
Addicted Member
Re: How to Read and Write Shortcuts
thanks too much for responding ... but for sorry the "Vb5stkit.dll" library not exist , I'm working at vb6 under operating system XP . and I used this modified function at XP and almost worked .
Public 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 Long, _
ByVal sParent As String) As Long
My proplem with this function that it creates only one shortcut and I must reboot my Own program to work again .
I also modified your OSfRemoveShellLink to Vb6stkit.dll and received no error but it didn't work(i don't know why).
I also need to know how to Read Shortcuts contents like (Target path - Icon - comment - parameter) , I hope to find an answer.
many thanks for efforts.
-
Jun 2nd, 2007, 10:30 AM
#4
Re: How to Read and Write Shortcuts
-
Jun 2nd, 2007, 11:37 AM
#5
Frenzied Member
Re: How to Read and Write Shortcuts
Nice link schoolbusdriver
-
Jun 18th, 2007, 11:16 AM
#6
Thread Starter
Addicted Member
Re: How to Read and Write Shortcuts
Many thanks to you all for help and support.
Some times when you make a step forward ...You can't get back. Be sure where you make your steps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|