Advertisement
Guest User

Untitled

a guest
Feb 19th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. public static void PrintRot()
  2. {
  3. IRunningObjectTable rot;
  4. IEnumMoniker enumMoniker;
  5. int retVal = GetRunningObjectTable(0, out rot);
  6.  
  7. if (retVal == 0)
  8. {
  9. rot.EnumRunning(out enumMoniker);
  10.  
  11. IntPtr fetched = IntPtr.Zero;
  12. IMoniker[] moniker = new IMoniker[1];
  13. while (enumMoniker.Next(1, moniker, fetched) == 0)
  14. {
  15. IBindCtx bindCtx;
  16. CreateBindCtx(0, out bindCtx);
  17. string displayName;
  18. moniker[0].GetDisplayName(bindCtx, null, out displayName);
  19. Console.WriteLine("Display Name: {0}", displayName);
  20. }
  21. }
  22. }
  23.  
  24. [DllImport("ole32.dll")]
  25. private static extern void CreateBindCtx(int reserved, out IBindCtx ppbc);
  26.  
  27. [DllImport("ole32.dll")]
  28. private static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable prot);
  29.  
  30. Display Name: !VisualStudio.DTE.11.0:7120
  31. Display Name: clsid:331F1768-05A9-4DDD-B86E-DAE34DDC998A:
  32. Display Name: !{7751A556-096C-44B5-B60D-4CC78885F0E5}
  33. Display Name: c:usersdavedocumentsvisual studio 2012ProjectsMyProjMyProj.sln
  34. Display Name: !{059618E6-4639-4D1A-A248-1384E368D5C3}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement