问题已经解决,用函数GetFileTitle代替。 下面是MSDN中该函数的说明: short GetFileTitle( LPCTSTR lpszFile, LPTSTR lpszTitle, WORD cbBuf ); ParameterslpszFile [in] Pointer to the name and location of a file. lpszTitle [out] Pointer to a buffer that receives the name of the file. cbBuf [in] Specifies the length, in TCHARs, of the buffer pointed to by the lpszTitle parameter. For the ANSI version of the function, this is in bytes; for the Unicode version, this is in characters.
下面是MSDN中该函数的说明:
short GetFileTitle( LPCTSTR lpszFile,
LPTSTR lpszTitle,
WORD cbBuf
);
ParameterslpszFile
[in] Pointer to the name and location of a file.
lpszTitle
[out] Pointer to a buffer that receives the name of the file.
cbBuf
[in] Specifies the length, in TCHARs, of the buffer pointed to by the lpszTitle parameter. For the ANSI version of the function, this is in bytes; for the Unicode version, this is in characters.