是否可以以编程方式清除Visual Studio(调试)“输出"窗口? [英] Can the Visual Studio (debug) Output window be programmatically cleared?

查看:150
本文介绍了是否可以以编程方式清除Visual Studio(调试)“输出"窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过编程方式清除Visual Studio OUTPUT 窗口?例如,SysInternal的调试器应用程序DebugView具有特定于命令的命令DBGVIEWCLEAR ..会清除日志窗口.

is it possible to have a way to clear the Visual Studio OUTPUT window, programmatically? For example, the SysInternal's debugger app called DebugView has the specific command called DBGVIEWCLEAR .. which clears the log window.

请不要说:右键单击,用鼠标清除窗口.我知道,但是那不是我想要的.

Please don't say: right-click, clear window .. with the mouse. I know that, but that's not what i'm after.

推荐答案

对于VS 2008,请尝试以下代码

For VS 2008 try this code

EnvDTE80.DTE2 ide = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0");
ide.ExecuteCommand("Edit.ClearOutputWindow", "");
System.Runtime.InteropServices.Marshal.ReleaseComObject(ide);

"VisualStudio.DTE.9.0"将在VS版本之间更改.

"VisualStudio.DTE.9.0" will change from VS version to version.

这篇关于是否可以以编程方式清除Visual Studio(调试)“输出"窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆