0

Possible Duplicate:
Capture console exit C#

In my c# addins, I have opened console window through AllocConsole() function and FreeConsole() for closing but after seeing my output when i click on console close button then it closes whole visual studio. so please give me some refrence code to handle console close button.

Community
  • 1
  • 1
user591790
  • 645
  • 2
  • 14
  • 33
  • 1
    This is by design. Don't use a console window, it is far too crude. – Hans Passant Mar 02 '11 at 11:40
  • If you really wanted to I suppose you could use MEF to integrate such a construct into your add-in or , better yet you could write a macro to run on compilation to pass whatever data you need to the console app. That way you could keep you design. But I'm not really sure, it would depend on what you want to do. – Terrance Mar 02 '11 at 15:04
  • Check this answer out for a moderately related topic. http://stackoverflow.com/questions/474679/capture-console-exit-c – Terrance Mar 02 '11 at 15:04

0 Answers0