谁知道这个函数的用法???SearchTreeForFile

pchobby 2002-12-18 08:36:27
SearchTreeForFile
...全文
139 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyl910 2002-12-18
  • 打赏
  • 举报
回复
'Search File
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()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim tempStr As String, Ret As Long
'create a buffer string
tempStr = String(MAX_PATH, 0)
'returns 1 when successfull, 0 when failed
Ret = SearchTreeForFile("c:\", "myfile.ext", tempStr)
If Ret <> 0 Then
MsgBox "Located file at " + Left$(tempStr, InStr(1, tempStr, Chr$(0)) - 1)
Else
MsgBox "File not found!"
End If
End Sub
zyl910 2002-12-18
  • 打赏
  • 举报
回复
Declare Function SearchTreeForFile Lib "imagehlp" (ByVal RootPath As String, ByVal InputPathName As String, ByVal OutputPathBuffer As String) As Long

?RootPath
[in] Pointer to a null-terminated string that specifies the path where the function should begin searching for the file.

?InputPathName
[in] Pointer to a null-terminated string that specifies the file for which the function will search. You can use a partial path.

?OutputPathBuffer
[out] Pointer to a buffer that receives the full path to the file that is found. This string is not modified if the return value is FALSE.

1,488

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧