Private Declare Function PathMatchSpec Lib "shlwapi.dll" Alias "PathMatchSpecA" _
(ByVal pszFileParam As String, ByVal pszSpec As String) As Long
Private Declare Function SendMessageAny Lib "user32.dll" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal MSG As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Const LB_SETTABSTOPS = &H192
Private Sub Command1_Click()
Dim YesNo(1) As String, Filter(4) As String, FileName As String
FileName = Me.Text1.Text
YesNo(0) = "No": YesNo(1) = "Yes"
Filter(0) = "*.exe"
Filter(1) = "*.e?e"
Filter(2) = "n?.exe"
Filter(3) = "notepad.exe"
Filter(4) = "not?pad.txt"
For a = 0 To 4
List1.AddItem Filter(a) & vbTab & vbTab & _
YesNo(PathMatchSpec(FileName, Filter(a)))
Next
End Sub
Private Sub Form_Load()
Dim Tabstop(1) As Long
Tabstop(0) = 50
Tabstop(1) = 50
Call SendMessageAny(Me.List1.hWnd, LB_SETTABSTOPS, 2, Tabstop(0))
End Sub |