This function closes an open object handle. A remote application programming interface (RAPI) version of this function exists, named CeCloseHandle (RAPI).
BOOL CloseHandle( HANDLE hObject );
[in] Handle to an open object.
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
The CloseHandle function closes handles to the following objects:
- Communications device
- Database enumeration context
- File-mapping object
CloseHandle invalidates the specified object handle, decrements the object's handle count, and performs object retention checks. After the last handle to an object is closed, the object is removed from the system. Persistent objects such as databases and files will remain in storage, but must be re-opened to be accessed again.
Closing a thread handle does not terminate the associated thread. To remove a thread object, you must terminate the thread, and then close all handles to the thread.
OS Versions: Windows CE 1.0 and later.
Link Library: Coredll.lib.
Last updated on Friday, April 09, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.