|
Tipp 0147
|
Datei-Verknüpfungen ermitteln
|
|
|
Autor/Einsender: Datum: |
|
Peter Wagenbauer 25.10.2001 |
|
Entwicklungsumgebung: |
|
VB 5 |
|
|
Mit der API-Funktion FindExecutable lässt sich recht einfach die mit
einer Datei verknüpfte Anwendung ermitteln.
|
|
|
Option Explicit
Private Declare Function FindExecutable Lib "shell32.dll" Alias _
"FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory _
As String, ByVal lpResult As String) As Long
Private Sub Drive1_Change()
On Error Resume Next
Dir1.Path = Drive1.Drive
Drive1.Drive = Dir1.Path
Text1.Text = ""
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
Text1.Text = ""
End Sub
Private Sub File1_Click()
Dim exe As String
Dim pfad As String
Dim datName As String
Dim result As Long
exe = Space(254) & Chr(0)
pfad = Dir1.Path
datName = File1.FileName
result = FindExecutable(datName, pfad, exe)
Text1.Text = Left(exe, InStr(exe, Chr(0)))
End Sub
|
|
|
|
|
Windows-Version |
95 |
|
|
98/SE |
|
|
ME |
|
|
NT |
|
|
2000 |
|
|
XP |
|
|
Vista |
|
|
Win
7 |
|
|
|
VB-Version |
VBA 5 |
|
|
VBA 6 |
|
|
VB 4/16 |
|
|
VB 4/32 |
|
|
VB 5 |
|
|
VB 6 |
|
|
|
|
Download (2,1 kB)
|
Downloads bisher: [ 1425 ]
|
|
|