Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void PrintRot()
- {
- IRunningObjectTable rot;
- IEnumMoniker enumMoniker;
- int retVal = GetRunningObjectTable(0, out rot);
- if (retVal == 0)
- {
- rot.EnumRunning(out enumMoniker);
- IntPtr fetched = IntPtr.Zero;
- IMoniker[] moniker = new IMoniker[1];
- while (enumMoniker.Next(1, moniker, fetched) == 0)
- {
- IBindCtx bindCtx;
- CreateBindCtx(0, out bindCtx);
- string displayName;
- moniker[0].GetDisplayName(bindCtx, null, out displayName);
- Console.WriteLine("Display Name: {0}", displayName);
- }
- }
- }
- [DllImport("ole32.dll")]
- private static extern void CreateBindCtx(int reserved, out IBindCtx ppbc);
- [DllImport("ole32.dll")]
- private static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable prot);
- Display Name: !VisualStudio.DTE.11.0:7120
- Display Name: clsid:331F1768-05A9-4DDD-B86E-DAE34DDC998A:
- Display Name: !{7751A556-096C-44B5-B60D-4CC78885F0E5}
- Display Name: c:usersdavedocumentsvisual studio 2012ProjectsMyProjMyProj.sln
- Display Name: !{059618E6-4639-4D1A-A248-1384E368D5C3}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement