-
Notifications
You must be signed in to change notification settings - Fork 0
/
M_defOS_FileFind.def
85 lines (68 loc) · 2.37 KB
/
M_defOS_FileFind.def
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Option Compare Database
Option Explicit
' By Doug Steele
' http://my.advisor.com/articles.nsf/aid/16279
' Replacement for application.FileSearch
' Modified by KD.Gundermann Sep 2009
Public Const INVALID_HANDLE_VALUE = -1
Public Const MAX_PATH = 260
Public Const vbBackslash = "\"
Public Const vbDot = 46
Public Enum FINDEX_INFO_LEVELS
FindExInfoStandard
FindExInfoBasic
FindExInfoMaxInfoLevel
End Enum
Public Enum FINDEX_SEARCH_OPS
FindExSearchNameMatch = 0
FindExSearchLimitToDirectories = 1
FindExSearchLimitToDevices = 2
End Enum
Public Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Public Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type
' FindFirstFile : http://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx
Public Declare Function FindFirstFile _
Lib "kernel32" Alias "FindFirstFileA" ( _
ByVal lpFileName As String, _
ByRef lpFindFileData As WIN32_FIND_DATA _
) As Long
' FindFirstFileEx : http://msdn.microsoft.com/en-us/library/aa364419(v=VS.85).aspx
Public Declare Function FindFirstFileEx Lib "kernel32.dll" _
Alias "FindFirstFileExA" ( _
ByVal lpFileName As String, _
ByVal fInfoLevelId As FINDEX_INFO_LEVELS, _
ByRef lpFindFileData As WIN32_FIND_DATA, _
Optional ByVal fSearchOp As FINDEX_SEARCH_OPS = FindExSearchNameMatch, _
Optional lpSearchFilter As Any = 0, _
Optional ByVal dwAdditionalFlags As Long = 0) As Long
' FindNextFile : http://msdn.microsoft.com/en-us/library/aa364428(v=VS.85).aspx
Public Declare Function FindNextFile _
Lib "kernel32" Alias "FindNextFileA" ( _
ByVal hFindFile As Long, _
ByRef lpFindFileData As WIN32_FIND_DATA _
) As Long
'
Private Declare Function PathMatchSpec _
Lib "shlwapi" Alias "PathMatchSpecW" ( _
ByVal pszFileParam As Long, _
ByVal pszSpec As Long _
) As Long
' FindClose : http://msdn.microsoft.com/en-us/library/aa364413(v=VS.85).aspx
Public Declare Function FindClose _
Lib "kernel32" ( _
ByVal hFindFile As Long _
) As Long