titim77
-
29 oct. 2001 à 22:55
jul00
Messages postés85Date d'inscriptionsamedi 20 novembre 2004StatutMembreDernière intervention18 juin 2009
-
8 juin 2005 à 09:05
salut tout le monde , je voudrais creer un raccourci
mais helas ca ne fonctionne pas voici le code
ou ai-je fais l'erreur ???
Private Declare Function OSfCreateShellLink Lib "vb6stkit.dll" Alias "fCreateShellLink" _
(ByVal lpstrFolderName As String, _
ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, _
ByVal lpstrLinkArguments As String, _
ByVal fPrivate As Long, _
ByVal sParent As String) As Long
Private Sub Command1_Click()
Call OSfCreateShellLink("C:\WINDOWS\Profiles\thierry\Menu Démarrer\Programmes\Démarrage", "essai raccourci", "c:\program files\dap\dap.exe", "", 0, "")
End
End Sub
merci pour votre precieuse aide :o)
A voir également:
Errordomain=nscocoaerrordomain&errormessage=impossible de trouver le raccourci spécifié.&errorcode=4
Moi pour créer un raccourci sur le bureau et/ou dans le menu démarrer voire les autres menus, j'utilise ce code
(Penser à référencer dans le projet WSHOM.OCX - windows script host object model)
(dans le code "projet1" correspond au programme pour lequel on veut un raccourci)
Private Sub Form_Load()
'Copie dans menu démarrage
Dim sDesk As String
Dim oShell As New IWshShell_Class
Dim oShortCut As New IWshShortcut_Class
jul00
Messages postés85Date d'inscriptionsamedi 20 novembre 2004StatutMembreDernière intervention18 juin 2009 8 juin 2005 à 09:05
moi je fait ca
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
Dim monrac
' Création d'un objet raccourci
Set monrac = WSHShell.CreateShortcut("chemin de ton raccouci")
' Paramétrage des propriétés de l'objet raccourci et sauvegarde
With monrac
.TargetPath = WSHShell.ExpandEnvironmentStrings("chemin de l'application vers la quelle pointe le raccourci")
.Save
End With