Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleFind the default executable for a file
Keywordsdefault, associated, executable, file
CategoriesFiles and Directories, Windows
 
Use the FindExecutable API function.
 
Private Sub cmdFindProgram_Click()
    file_name = txtFileName.Text
    pos = InStrRev(file_name, "\")
    file_path = Left$(file_name, pos)
    file_name = Mid$(file_name, pos + 1)
    result = Space$(1024)

    FindExecutable file_name, file_path, result

    pos = InStr(result, Chr$(0))
    result = Left$(result, pos - 1)

    lblResult.Caption = result
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated