http://msdn.microsoft.com/en-us/library/aa365430(v=vs.85).aspx
OpenFile function
HFILE WINAPI OpenFile( _In_ LPCSTR lpFileName, _Out_ LPOFSTRUCT lpReOpenBuff, _In_ UINT uStyle );
Return value
If the function succeeds, the return value specifies a file handle to use when performing file I/O. To close the file, call the CloseHandle function using this handle.
If the function fails, the return value is HFILE_ERROR. To get extended error information, call GetLastError.
Remarks
If the lpFileName parameter specifies a file name and extension only, this function searches for a matching file in the following directories and the order shown:
-
The directory where an application is loaded.
-
The current directory.
-
The Windows system directory.
Use the GetSystemDirectory function to get the path of this directory.
-
The 16-bit Windows system directory.
There is not a function that retrieves the path of this directory, but it is searched.
-
The Windows directory.
Use the GetWindowsDirectory function to get the path of this directory.
-
The directories that are listed in the PATH environment variable.
The lpFileName parameter cannot contain wildcard characters.