DuduArbel
DuduArbel

Reputation: 1178

clear the Visual Studio OUTPUT window programmatically

is it possible to have a way to clear the Visual Studio OUTPUT window, programmatically for a C++ program? Today I use OutputDebugString call to write there, and at some point I want to clear it. Is this possible?

I use VS2008

Upvotes: 5

Views: 6561

Answers (2)

Malcolm McLean
Malcolm McLean

Reputation: 6404

There is an answer, but it's not what you really want.

printf("\f");

will print a form feed to the console. That is supposed to clear it. In fact modern consoles store histories which are hard to clear in a definite way.

Upvotes: 0

JeffRSon
JeffRSon

Reputation: 11176

No, it is not possible. Simply because OutputDebugString is not related at all to the Visual Studio output window itself. This output window just happens to be a listener for this kind of messages. There are other listeners like DebugView. But there's no message like "forget all previous messages".

If you absolutely need such "feature" you may think about logging to a seperate console window and clean this like desribed here: http://support.microsoft.com/kb/99261/EN-US

Upvotes: 4

Related Questions