Export (0) Print
Expand All
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

FindClose function

Closes a file search handle opened by the FindFirstFile, FindFirstFileEx, FindFirstFileNameW, FindFirstFileNameTransactedW, FindFirstFileTransacted, FindFirstStreamTransactedW, or FindFirstStreamW functions.

Syntax


BOOL WINAPI FindClose(
  _Inout_  HANDLE hFindFile
);

Parameters

hFindFile [in, out]

The file search handle.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

After the FindClose function is called, the handle specified by the hFindFile parameter cannot be used in subsequent calls to the FindNextFile, FindNextFileNameW, FindNextStreamW, or FindClose functions.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

TechnologySupported

Server Message Block (SMB) 3.0 protocol

Yes

SMB 3.0 Transparent Failover (TFO)

Yes

SMB 3.0 with Scale-out File Shares (SO)

Yes

Cluster Shared Volume File System (CsvFS)

Yes

Resilient File System (ReFS)

Yes

 

Examples

For an example, see Listing the Files in a Directory.

Requirements

Minimum supported client

Windows XP [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Header

FileAPI.h (include Windows.h);
WinBase.h on Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

File Management Functions
FindFirstFile
FindFirstFileEx
FindFirstFileNameW
FindFirstFileNameTransactedW
FindFirstFileTransacted
FindFirstStreamTransactedW
FindFirstStreamW
FindNextFile
FindNextFileNameW
FindNextStreamW

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.