Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Find default application for a file


Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" _
                           ( ByVal lpFile As String , ByVal lpDirectory As String , _
                            ByVal lpResult As String ) As Long
Const MAX_PATH = 260


Dim iResult As Long
Dim Buffer As String
Buffer = Space$(MAX_PATH)
iResult = FindExecutable( "c:\test.txt" , "" , Buffer)