Selasa, 21 Juli 2009

How To Find Files with VB

Private Declare Function SearchTreeForFile Lib "imagehlp" _
(ByVal RootPath As String, ByVal InputPathName As String, _
ByVal OutputPathBuffer As String) As Long
Private Const MAX_PATH = 260
Private Sub Form_Load()

Dim tempStr As String, Ret As Long
tempStr = String(MAX_PATH, 0)
Ret = SearchTreeForFile("c:", "calc.exe", tempStr)
If Ret <> 0 Then
MsgBox "Lokasi file di " + Left$(tempStr, _
InStr(1, tempStr, Chr$(0)) - 1)
MsgBox "File tidak ditemukan!"
End If
End Sub

Tidak ada komentar:

Posting Komentar