Make your own free website on Tripod.com

AllApi.net

[an error occurred while processing this directive]
 
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 Form_Load()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
Dim i As Integer, s2 As String
Const sFile = "C:\Windows\Readme.txt"

'Check if the file exists
If Dir(sFile) = "" Or sFile = "" Then
        MsgBox "File not found!", vbCritical
        Exit Sub
End If
'Create a buffer
s2 = String(MAX_FILENAME_LEN, 32)
'Retrieve the name and handle of the executable, associated with this file
i = FindExecutable(sFile, vbNullString, s2)
If i > 32 Then
     MsgBox Left$(s2, InStr(s2, Chr$(0)) - 1)
Else
     MsgBox "No association found !"
End If
End Sub


 
Copyright © 1998-2000, The KPD-Team.
Send mail to KPDTeam@Allapi.net with comments about this web site.
This site is located at
http://www.Allapi.net/