using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using Microsoft.VisualBasic; namespace EnumRot { class Program { [DllImport("ole32.dll")] public static extern void CreateBindCtx( int reserved, out IBindCtx ppbc); [DllImport("ole32.dll")] public static extern void GetRunningObjectTable( int reserved, out IRunningObjectTable prot); static void Main() { IRunningObjectTable rot; IEnumMoniker enumMoniker; IntPtr fetched = IntPtr.Zero; IMoniker[] Moniker = new IMoniker[1]; GetRunningObjectTable(0, out rot); rot.EnumRunning(out enumMoniker); enumMoniker.Reset(); while (enumMoniker.Next(1, Moniker, fetched) == 0) { IBindCtx bindCtx; string displayName; object ComObject; CreateBindCtx(0, out bindCtx); Moniker[0].GetDisplayName(bindCtx, null, out displayName); rot.GetObject(Moniker[0], out ComObject); Console.WriteLine("-----------------------------------"); //Console.WriteLine(displayName); Console.WriteLine(Information.TypeName(ComObject)); } } } }
Information.Typename()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)