I have a list of DirectShow filters in C# using DirectShow.NET. I get a list of filters by IFilterMapper2.EnumMatchingFilters()
. But I've got just FriendlyName
and FilterData
:
hr = propertyBag.Read("FriendlyName", out friendlyName, null);
hr = propertyBag.Read("FilterData", out filterDataObj, null);
I would like to have get "File Name", and "File Version", which shows GraphStudioNext and other tools. How can I retrieve these informations?
I have looked into the GraphStudioNext sources and found that I have to get CLSID and get dll file name from registry:
hr = propertyBag.Read("CLSID", out clsid, null);
string dllFile = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey("CLSID\\" + clsid + "\\InProcServer32").GetValue("") as string;
Finally, the File version can be retrieved by:
string fileVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(dllFile).FileVersion;