Continues enumerating the hard links.
#Include <WinAPIEx.au3>
_WinAPI_FindNextFileName ( $hSearch, ByRef $sLink )
$hSearch | A handle to the enumeration that is returned by a successful call to _WinAPI_FindFirstFileName() function. |
$sLink | The next link name that was found. |
成功: | 返回 1. |
失败: | 返回 0 并设置 @error 标志为非 0 值, @extended 标志可能包含一个系统错误代码. |
在MSDN中搜索
#Include <Array.au3>
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global Const $sFile = @DesktopDir & '\@' & StringRegExpReplace(_WinAPI_PathFindFileName(@ScriptName), '\A_+', '')
Global $hSearch, $sLink
; Create hard link to the current file with prefix "@" on your Desktop
_WinAPI_CreateHardLink($sFile, @ScriptFullPath)
If @error Then
MsgBox(16, 'Error', 'Unable to create hard link.')
Exit
EndIf
; Enumerate all hard links to the file
$hSearch = _WinAPI_FindFirstFileName($sFile, $sLink)
While Not @error
ConsoleWrite(_WinAPI_PathAppend(_WinAPI_PathStripToRoot($sFile), $sLink) & @CR)
_WinAPI_FindNextFileName($hSearch, $sLink)
WEnd
Switch @extended
Case 38 ; ERROR_HANDLE_EOF
Case Else
MsgBox(16, @extended, _WinAPI_GetErrorMessage(@extended))
EndSwitch
FileDelete($sFile)