c# - How to send a proper message to Console application using user32.dll's SendMessage -
i'm trying send text console when requires console.readline() input, different thread (windows form textbox). problem can't seem figure out how send text , have show wrote it. example: "test test 123" show in console as: test test &é" image: http://puu.sh/gijw8/e9f4d94bd5.png using system; using system.windows.forms; using system.io; using system.runtime.interopservices; using system.diagnostics; namespace consoleapplication1 { public partial class form1 : form { [dllimport("user32.dll", entrypoint = "postmessagea")] private static extern bool postmessage(intptr hwnd, uint msg, intptr wparam, int lparam); [dllimport("user32.dll")] static extern short vkkeyscan(char ch); [dllimport("user32.dll", entrypoint = "sendmessagea")] public static extern int sendmessage(intptr hwnd, int umsg, int wparam, string lparam); [dllimport("kernel32