Angelo Lee's Blog
This is my kingdom .If i don't fight for it ,who will ?

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:

  1. The directory where an application is loaded.

  2. The current directory.

  3. The Windows system directory.

    Use the GetSystemDirectory function to get the path of this directory.

  4. The 16-bit Windows system directory.

    There is not a function that retrieves the path of this directory, but it is searched.

  5. The Windows directory.

    Use the GetWindowsDirectory function to get the path of this directory.

  6. The directories that are listed in the PATH environment variable.

The lpFileName parameter cannot contain wildcard characters.


posted on 2012-11-25 21:23  Angelo Lee  阅读(202)  评论(0编辑  收藏  举报