HI,
Windows provides descriptions for file extension such as \"Control Panel Item\" for .cpl files and \"PowerISO File\" for .daa files. Is there any way I can obtai
In order to use SHGetFileInfo
the file must exist on disk. If you only have the name of the file, or even just the extension, you will need to get the information directly from the registry:
public static string GetFileTypeDisplayName(string extension) =>
Registry.ClassesRoot.OpenSubKey(extension)?.GetValue(null) is string keyName ?
Registry.ClassesRoot.OpenSubKey(keyName)?.GetValue(null) as string :
null;
This method will simply return null
if there is no suitable entry in the registry for the given file extension.