开发者

Is there an equivalent of DoEvents in Visual Studio macros?

I've got a long-running macro, in which I write periodic messages to Output just so that the user know somethings happening. The problem is that the output doesn't get shown until the macro has finished (unless you have the Continue Waiting? dialog box open, strangely enough).

Is there anyway to开发者_Go百科 'flush' the event queue?


If you reference Windows Forms you can access Application.DoEvents as normal.

I have the main IDE responding to windows updates and closes in real time while the macro is still running with only

    DTE.SuppressUI = False
    Threading.Thread.Sleep(5000)

As such I suggest using a standard DoEvents & Sleep(55) loop for a 250 milliseconds or so when you want to ensure the UI is updated should do the trick, along with the SuppressUI=False.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜