FindClose 函式 (fileapi.h)

關閉 FindFirstFileFindFirstFileEx、FindFirstFileNameWFindFirstFileNameTransactedWFindFirstFileTransacted、FindFirstStreamTransactedWFindFirstStreamW 函式所開啟的檔案搜尋句柄。

語法

BOOL FindClose(
  [in, out] HANDLE hFindFile
);

參數

[in, out] hFindFile

檔案搜尋句柄。

傳回值

如果函式成功,則傳回非零的值。

如果此函式失敗,則傳回值為零。 若要取得擴充的錯誤資訊,請呼叫 GetLastError

備註

呼叫 FindClose 函式之後, hFindFile 參數指定的句柄無法用於後續對 FindNextFileFindNextFileNameWFindNextStreamWFindClose 函式的呼叫。

在 Windows 8 和 Windows Server 2012 中,下列技術支援此函式。

技術 支援
伺服器消息塊 (SMB) 3.0 通訊協定 Yes
SMB 3.0 透明故障轉移 (TFO) Yes
具有向外延展檔案共用的SMB 3.0 (SO) Yes
叢集共用磁碟區文件系統 (CsvFS) Yes
彈性檔案系統 (ReFS)
 

範例

如需範例,請參閱 列出目錄中的檔案

規格需求

需求
最低支援的用戶端 Windows XP [傳統型應用程式 |UWP 應用程式]
最低支援的伺服器 Windows Server 2003 [傳統型應用程式 |UWP 應用程式]
目標平台 Windows
標頭 fileapi.h (包含 Windows.h)
程式庫 Kernel32.lib
DLL Kernel32.dll

另請參閱

檔案管理功能

FindFirstFile

FindFirstFileEx

FindFirstFileNameTransactedW

FindFirstFileNameW

FindFirstFileTransacted

FindFirstStreamTransactedW

FindFirstStreamW

FindNextFile

FindNextFileNameW

FindNextStreamW