Marshow
asked on
Getting FileType with MFC
I recently started using c++ with MFC, but I can't find all the functions that the api has.
I usually used the SHGetFileInfo with the SHGFI_TYPENAME argument to receive the filetype before I began with MFC.
Now I use the CFileFind class to locate files on the harddisk, it works fine, but I can't find any function that receives the FileType... I've searched for other classes like the CFile but with no succeed.
how do I receive the filetype description of a file?
I usually used the SHGetFileInfo with the SHGFI_TYPENAME argument to receive the filetype before I began with MFC.
Now I use the CFileFind class to locate files on the harddisk, it works fine, but I can't find any function that receives the FileType... I've searched for other classes like the CFile but with no succeed.
how do I receive the filetype description of a file?
Can you give me an example of what you mean by file type?
ASKER
A description of the extension like "Winamp media file" or "Textdocument" or "WinRAR ZIP Archive".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>I usually used the SHGetFileInfo with the SHGFI_TYPENAME argument to receive the filetype before I began with MFC.
Why did you stop using it? All Win32 API fns are availabe in MFC. Example:
SHFILEINFO rInfo;
SHGetFileInfo( "*.ZIP", 0, &rInfo, sizeof(rInfo), SHGFI_TYPENAME );
MessageBox( rInfo.szTypeName, "The type is..." );
-- Dan
Why did you stop using it? All Win32 API fns are availabe in MFC. Example:
SHFILEINFO rInfo;
SHGetFileInfo( "*.ZIP", 0, &rInfo, sizeof(rInfo), SHGFI_TYPENAME );
MessageBox( rInfo.szTypeName, "The type is..." );
-- Dan
ASKER
aha, ok, I thought that all api functions was included within the MFC.
You were correct before: All Win32 API functions are included in MFC.
-- Dan
-- Dan