How do I get the general File type description based on extension like Explorer does it? So not MIME but the information that the end-user sees, like.
.doc = Microso
Some extra if's for unknown file types in XP.. May not really give the right results when using it with anything but FriendlyDocName, but just as an example:
public static string FileExtentionInfo(AssocStr assocStr, string doctype)
{
if ((doctype.Length <= 1) || !doctype.StartsWith(".")) return "";
uint pcchOut = 0;
AssocQueryString(AssocF.Verify, assocStr, doctype, null, null, ref pcchOut);
if (pcchOut == 0) return (doctype.Trim('.').ToUpper() + " File");
StringBuilder pszOut = new StringBuilder((int)pcchOut);
AssocQueryString(AssocF.Verify, assocStr, doctype, null, pszOut, ref pcchOut);
return pszOut.ToString();
}