问题
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