Closes an open object handle. - hObject [in] A valid handle to
an open object. 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. If the
application is running under a debugger, the function will throw
an exception if it receives either a handle value that is not
valid or a pseudo-handle value. This can happen if you close a
handle twice, or if you call CloseHandle on a handle returned by
the FindFirstFile function instead of calling the FindClose
function. The CloseHandle function closes handles to the
following objects: - Access token - Communications device -
Console input - Console screen buffer - File mapping - I/O
completion port - Memory resource notification - Named pipe -
Waitable timer The documentation for the functions that create
these objects indicates that CloseHandle should be used when you
are finished with the object, and what happens to pending
operations on the object after the handle