none
VS2008 shell: Getting the build output pane to become visible? RRS feed

  • Question

  • Hi,

    I have a custom action on file nodes that causes output to show in the Build output pane.
    I have an issue with the output pane not appearing when a different tab is selected.

    I tried using the following code to make it appear, but it fails.

                        IVsOutputWindow output = (IVsOutputWindow)this
    .ProjectMgr.Site.GetService(typeof
    (SVsOutputWindow));
                        IVsOutputWindowPane outputWindowPane = null
    ;
                        Guid buildOutputPaneGuid = new
     Guid(VSConstants.BuildOutput.ToString());
                        IVsCfg configurationInterface;
                        EnvDTE.Project automationObject = this
    .GetAutomationObject() as
     EnvDTE.Project;
                        string
     currentConfig = Utilities.GetActiveConfigurationName(automationObject);
                        ErrorHandler.ThrowOnFailure(this
    .ProjectMgr.ConfigProvider.GetCfgOfName(currentConfig, string
    .Empty, out
     configurationInterface));
    
                        string
     configAndPlatform = String.Empty;
                        configurationInterface.get_DisplayName(out
     configAndPlatform);
    
                        outputWindowPane.Clear();                    
                        outputWindowPane.Activate(); // TODO: Find out why the doesn't show the panel when another tab is selected
    
    
    Also, I need to only enable this feature when the Visual Studio option:
    Tools->Options->Projects And Solutions->General->"Show output window when build starts" is checked.


    Anyone have experience with getting a hidden tab (build output) to become visible?

    Thanks,

    Eric
    • Edited by emaines Thursday, August 20, 2009 6:07 PM merged text
    Thursday, August 20, 2009 4:03 PM

Answers

  • Hi Eric,

    IVsOutputWindowPane.Activate() seems to me that it just select and activate the specified pane in the Output window for us, if you want to activate the Output window, please try EnvDTE.Toolwindows.OutputWindow.Parent.Activate().

    Please feel free to let me know if I misunderstood your question.

    Sincerely,
    Wesley
    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Proposed as answer by The old KAKU Monday, August 24, 2009 9:53 AM
    • Marked as answer by Wesley Yao Thursday, August 27, 2009 2:52 AM
    Monday, August 24, 2009 5:34 AM
  • Hi,
    The IVsOutputWindowPane.Activate() method described in MSDN is "Shows and activates the Output window pane.", so base on my understanding this method is used to set the active pane within the outputWindow, in other words this method has nothing to do with the focus among the tabs.

    You should try another way to satisfy your needs, for instance you can use the automation model to finish this task, Firstly get the automation model in Vspackage using the DTE dte = GetService(typeof(SDTE)) as DTE; ,secondly execute the command dte.ExecuteCommand("View.Output", string.Empty); after your outputWindowPane.Activate(); method.  If you follow the steps I described before, you could make your outputWindow focused.

    If I misunderstood you, please let me know.

    Kaku

    • Marked as answer by Wesley Yao Thursday, August 27, 2009 2:52 AM
    Monday, August 24, 2009 6:25 AM

All replies

  • Hi Eric,

    IVsOutputWindowPane.Activate() seems to me that it just select and activate the specified pane in the Output window for us, if you want to activate the Output window, please try EnvDTE.Toolwindows.OutputWindow.Parent.Activate().

    Please feel free to let me know if I misunderstood your question.

    Sincerely,
    Wesley
    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Proposed as answer by The old KAKU Monday, August 24, 2009 9:53 AM
    • Marked as answer by Wesley Yao Thursday, August 27, 2009 2:52 AM
    Monday, August 24, 2009 5:34 AM
  • Hi,
    The IVsOutputWindowPane.Activate() method described in MSDN is "Shows and activates the Output window pane.", so base on my understanding this method is used to set the active pane within the outputWindow, in other words this method has nothing to do with the focus among the tabs.

    You should try another way to satisfy your needs, for instance you can use the automation model to finish this task, Firstly get the automation model in Vspackage using the DTE dte = GetService(typeof(SDTE)) as DTE; ,secondly execute the command dte.ExecuteCommand("View.Output", string.Empty); after your outputWindowPane.Activate(); method.  If you follow the steps I described before, you could make your outputWindow focused.

    If I misunderstood you, please let me know.

    Kaku

    • Marked as answer by Wesley Yao Thursday, August 27, 2009 2:52 AM
    Monday, August 24, 2009 6:25 AM
  • Hi Kakuchyou ,

    Sorry for the late reply.

    Your answer worked!

    Thanks

    Eric
    Tuesday, December 8, 2009 3:57 PM