How to get a programmable interface to the Visual

2020-07-22 19:22发布

I am working on a Visual Studio add-in (part of the ILSpy open source project) and I want to get information about the currently selected stack frame in the Visual Studio Call Stack window.

I tried this:

var callstackWindow = ((EnvDTE80.DTE2)GetGlobalService(typeof(EnvDTE.DTE))).ToolWindows.GetToolWindow("Call Stack");

However it throws an exception when not debugging (and Call Stack window not present) and returns null when the Call Stack window is present.

There is a vsWindowTypeCallStack member in the vsWindowType enumeration, but I can't find any API that uses it. I've searched the EnvDTE documentation without finding any further information.

I'm working in C# with Visual Studio 2013 Professional.

0条回答
登录 后发表回答