Try this sample:
VB Code:
Option Explicit
Private Const MAX_FILENAME_LEN = 260
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 Command2_Click()
Dim i As Integer, s2 As String
Dim sFile$
'create a temp file
sFile = App.Path & "\test.htm"
Open sFile For Output As #1
Print #1, "http://www.microsoft.com"
Close #1
'Create a buffer
s2 = String(MAX_FILENAME_LEN, 32)
'Retrieve the name and handle of the executable
i = FindExecutable(sFile, vbNullString, s2)
If i > 32 Then
MsgBox Left$(s2, InStr(s2, Chr$(0)) - 1)
Else
MsgBox "No association found !"
End If
'delete temp file
Kill sFile
End Sub