SimoneLucca
08-10-2002, 20:12
Vorrei creare un bottone che mi lancia un file eseguibile.
Altra domandina.... come posso creare un collegamento ad un eseguibile sul desktop???
Grazie mille.
1) usa l'api shellexecute
Declare Function ShellExecute Lib "shell32.dll" 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
2)
Declare Function fCreateShellLink Lib "Vb5stkit.dll" _
(ByVal lpstrFolderName As String, _
ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, _
ByVal lpstrLinkArgs As String) As Long
'se si usa vb4 la dll è STKIT432.DLL
Call fCreateShellLink(Percorso, nome_collegamento, _
percorso_applicazione_a_cui_collegare,"")
'Il primo parametro (lpstrFolderName) si riferisce alla
'directory Programmi (di solito in c:\windows\menu avvio\programmi)
'per risalire è necessario usare "..\"
'esempio: crea un collegamento al blocco note sul desktop
Call fCreateShellLink("..\..\Desktop", "Collegamento a notepad", _
"c:\windows\notepad.exe", "")
SimoneLucca
09-10-2002, 01:25
grazie mille sei stato molto utile!
Simone
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.