Retrieves the title of a file.
Also see GetFileTitleA.
BOOL GetFileTitleW(
_In_ LPCWSTR lpszFile,
_Out_ LPWSTR lpszTitle,
_In_ UINT cchTitle
);
lpszTitle
.
lpszTitle
, not including the terminating null character.
GetLastError
.
This function extracts the file title from a file path.
The title is the portion of the file path following the last backslash character or the entire path if no backslash character is present.
The function handles both ANSI and Unicode strings. The GetFileTitle
function is an alias for GetFileTitleW
.
If the file name contains no extension, the file title will not contain an extension.
The buffer pointed to by lpszTitle
must be large enough to hold the file title plus the null terminator.
Consider using SHGetFileInfo with the SHGFI_DISPLAYNAME
flag to get the display name of a file, which may include the extension.
Header | comdlg32.h (include windows.h ) |
---|---|
Library | Comdlg32.lib |
DLL | Comdlg32.dll |