How to build shortcuts with VB

zhaozj2021-02-17  45

How to create a shortcut below to demonstrate how to create a shortcut in VB in VB. Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long Sub Command1_Click () Dim lReturn As Long 'is added to the desktop lReturn = fCreateShellLink ( " ../../Desktop "," Shortcut to Calculator "," C: /Windows/calc.exe "," ") Add to Program Lreturn = FcreatesHellLink (" "," Shortcut to Calculator "," C: / Windows/calc.exe "," ") 'Add to the startup group Lreturn = FcreateshellLink (" / Startup "," Shortcut to Calculator "," C: /Windows/calc.exe "," ") End Sub

转载请注明原文地址:https://www.9cbs.com/read-29654.html

New Post(0)