Exécuter un raccourci (lnk)

MacgyverJC - 28 nov. 2001 à 10:22
EmmanuelRietsch Messages postés 1 Date d'inscription jeudi 10 octobre 2002 Statut Membre Dernière intervention 10 octobre 2002 - 10 oct. 2002 à 16:06
Je n'ai trouvé (pour l'instant) pour exécuter un lnk du bureau que la méthode MSDOS:
shell "START fichier.lnk"
mais comme cela ne marche pas je suis obligé de faire un batch dans lequel j'ai: START fichier.lnk
et je n'ai plus qu'à faire
shell fichier.bat

mais cé pas bô!

Y'a pas une + belle solution?

1 réponse

EmmanuelRietsch Messages postés 1 Date d'inscription jeudi 10 octobre 2002 Statut Membre Dernière intervention 10 octobre 2002
10 oct. 2002 à 16:06
Salut a vous Voila la solution pour les LNK
Je sais sais presque un ans apres mais j'ai apeine lu

A plus

Private Declare Function GetDesktopWindow Lib "user32" () As Long

Private Declare Function ShellExecute Lib "shell32" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWDEFAULT As Long = 10
Private Const SE_ERR_NOASSOC As Long = 31

Private Sub Command1_Click()
ShellExecute hwnd, vbNullChar, "11.lnk", vbNullChar, vbNullChar, SW_SHOWNORMAL
End Sub

Private Sub Form_Load()
Dim hWndDesk As Long
Dim success As Long
hWndDesk = GetDesktopWindow()
End Sub
0
Rejoignez-nous