-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFORM1.FRM
43 lines (40 loc) · 1.29 KB
/
FORM1.FRM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5325
ClientLeft = 2745
ClientTop = 1935
ClientWidth = 7200
LinkTopic = "Form1"
ScaleHeight = 5325
ScaleWidth = 7200
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
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: [email protected]
Dim i As Integer, s2 As String
Const sFile = "C:\Windows\leame.htm"
'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