How do I access the Windows Console API for the console from C#. Specifically how do I exploit the SetConsoleMode property for the Console? Is there a big performance cost? or Is there another way to set the Console's mode in C#?
Asked
Active
Viewed 254 times
0
-
1It is already in insert mode by default. Just try it with a Console.ReadLine() call, type something, use the left cursor key and type something. What are you *really* trying to do? – Hans Passant Sep 19 '13 at 16:51
-
@HansPassant That is definitely useful info. I want to somehow insure that some threaded console.writes stay together, while others are separate, and of course I want to avoid locks. – amalgamate Sep 19 '13 at 17:14
-
There's absolutely nothing that SetConsoleMode() can do to make that easier. Of course you need a lock. – Hans Passant Sep 19 '13 at 17:17
-
@HansPassant I started with this http://stackoverflow.com/questions/18896404/writing-to-console-in-c-can-you-single-writeline-with-multiple-colors-or-lock/18897064?noredirect=1#comment27895314_18897064. My gut says that Servy is giving the answer to my problem, or a good answer to my problem, however I do not quite see the whole picture despite his patient efforts. – amalgamate Sep 19 '13 at 17:17
-
I was thinking that I could insert at the correct spot in the line, but I see why that wont be a good solution now. – amalgamate Sep 19 '13 at 17:21