1 out of 1 rated this helpful - Rate this topic

FindClose function

Applies to: desktop apps | Metro style apps

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.

Examples

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

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

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

 

 

Send comments about this topic to Microsoft

Build date: 4/17/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
C# Syntax
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
public static extern bool FindClose([In] Integer handle);
vb.net syntax
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, SetLastError:=True)> _
Public Shared Function FindClose(<[In]> ByVal handle As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function