Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8027075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:42:03+00:00 2026-06-04T23:42:03+00:00

I have some C# code writing progress messages to a Visual Studio 2010 EnvDTE.OutputWindowPane.

  • 0

I have some C# code writing progress messages to a Visual Studio 2010 EnvDTE.OutputWindowPane. The code is invoked from a Visual Studio menu (it’s in a VSPackage).

The problem is that the output window is not repainted until all processing invoked by the menu pick is complete, so the output appears all at once rather than when each line is added. I suspect that this is related to all processing being performed on the main thread, so the Visual Studio UI can’t repaint.

Is there a way to “pump messages” in Visual Studio to update the UI — like Application.DoEvents()? The VSPackage also inserts some items in the project and that seems to happen “on the fly” — it’s only the output window that appears to lag behind.

I spelunked through the various DTE objects without finding any candidates for this functionality.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T23:42:05+00:00Added an answer on June 4, 2026 at 11:42 pm

    Sorry for the silence — I was just reminded of this question and thought I’d answer it myself.

    I was able to largely solve the problem by creating a progress bar window that appears while the main Visual Studio thread is off running my code and not updating the UI. The progress bar (IVsThreadedWaitDialog2) is very poorly documented, but it appears to run on a worker thread and puts Visual Studio into a modal state while active. So that, at least, keeps Visual Studio from looking like it’s hung during during processing.

    The progress bar window is the same one that appears when Visual Studio is loading a large solution and has the option of a Cancel button.

    Unfortunately, the progress bar dialog has several bugs (reported to Microsoft), the most significant of which is that it often appears behind the Visual Studio window — truly annoying. That’s kind of a show-stopper, so whenever the progress bar is updated, I use a variation of the code here to locate the progress window by its title and bring it to the top of the Visual Studio window stack.

    Moving the processing to a worker thread didn’t work very well, as it executes shared code that manipulates text in the Visual Studio editor, and the results of those manipulations were erratic (sometimes it would work, sometimes an inscrutable COM error was returned, which seemed to be timing-dependent).

    I also did finally find a message pump in Visual Studio — the shell contains a class called CommonMessagePump. Again, it is very poorly documented and I could never get it working quite right based on the information that was available. In any case the progress dialog has solved my problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been writing some code to create a byte array I will be
I'm writing some code here, and I'm having a had time. I have a
I have come across an annoying problem while writing some PHP4 code. I renamed
I have been messing around with writing some stored procedures in .NET code with
I am writing some Natural Language Processing code and want to have a binary
I have some trouble writing some code (I might be tired), so I need
I have some file writing code that works as expected, but prints an error
I'm writing a library that needs to have some code if a particular library
I have some VHDL code I'm writing for a class. However, the synthesis tool
I have some code that reads from an ini file in Javascript, using activex

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.