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
 
Weitere Links zum Thema
Datei per verknüpfter Anwendung drucken
Icons und verknüpfte Symbole anzeigen

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: [ 1408 ]

Vorheriger Tipp Zum Seitenanfang Nächster Tipp

Startseite | Projekte | Tutorials | API-Referenz | VB-/VBA-Tipps | Komponenten | Bücherecke | VB/VBA-Forum | VB.Net-Forum | DirectX-Forum | Foren-Archiv | DirectX | VB.Net-Tipps | Chat | Spielplatz | Links | Suchen | Stichwortverzeichnis | Feedback | Impressum

Seite empfehlen Bug-Report
Letzte Aktualisierung: Samstag, 27. August 2011