How to send keys data to a Console window without having focus
问题 I've been trying to send data to a console window without it having focus. I've used a simple Keyboard Hook from here: Capture keystroke without focus in console I've modified the code provided from the answer on that page to display the unicode values of keys that have been pressed; my modifications are as follows: private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) { var vkCode = Marshal.ReadInt32(lParam); var key =