Activate Visual Studio's Output window using DTE

ぐ巨炮叔叔 提交于 2019-12-11 13:43:54

问题


I've created a custom output window pane for my VSPackage:

Using this code:

// Creating Output Window for our package.
IVsOutputWindow output = GetService(typeof(SVsOutputWindow)) as IVsOutputWindow;
Guid guildGeneral = Microsoft.VisualStudio.VSConstants.OutputWindowPaneGuid.GeneralPane_guid;
int hr = output.CreatePane(guildGeneral, "Codex", 1, 0);
hr = output.GetPane(guildGeneral, out ApplicationConstants.pane);

ApplicationConstants.pane.Activate();

QUESTION

How can I select the Output tab when other tabs are currently selected?


回答1:


To activate (focus) on Visual Studio's Output window:

DTE dte = (DTE)GetService(typeof(DTE));
Window window = dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
window.Activate();


来源:https://stackoverflow.com/questions/31125153/activate-visual-studios-output-window-using-dte

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!