Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
1/6/2010
To use OS resources efficiently, an application should close files when they are no longer needed by using the CloseHandle function. If a file is open when an application terminates, the system closes it automatically.
The following example closes the file named Myfile.txt, whose handle is stored in the hFile variable.
CloseHandle(hFile);
Closing a file does not delete the file from disk. For more information, see Deleting a File or a Directory.