CloseHandle. The CloseHandle function closes an open object handle. BOOL CloseHandle( HANDLE hObject // handle to object to close ); Parameters hObject Handle to an open object. Return Values. 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