The CloseHandle function closes an open object handle.
BOOL CloseHandle(
HANDLE hObject |
// handle to object to close |
); |
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.
The CloseHandle function closes handles to the following objects:
CloseHandle invalidates the specified object handle, decrements the object’s handle count, and performs object retention checks. Once the last handle to an object is closed, the object is removed from the operating system.
This function does not close module objects.
Use CloseHandle to close handles returned by calls to the CreateFile function. Use FindClose to close handles returned by calls to the FindFirstFile function.
Closing an invalid handle raises an exception. This includes closing a handle twice, not checking the return value and closing an invalid handle, and using CloseHandle on a handle returned by FindFirstFile.
CreateFile, DeleteFile, FindClose, FindFirstFile
file: /Techref/os/win/api/win32/func/src/f06_4.htm, 2KB, , updated: 2001/6/23 22:02, local time: 2024/11/25 10:01,
3.144.25.248:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/Techref/os/win/api/win32/func/src/f06_4.htm"> CloseHandle</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.