private void bStatus_Click(object sender, EventArgs e) { //Find the console edit box aswell as send the status command - works fine. string message = "status"; StringBuilder sb = new StringBuilder(message); IntPtr MW4CONSOLE = FindWindow("IW4 WinConsole", null); IntPtr MW4EDIT = FindWindowEx(MW4CONSOLE, IntPtr.Zero, "Edit", IntPtr.Zero); SendMessage(MW4EDIT, WM_SETTEXT, IntPtr.Zero, sb); PostMessage(MW4EDIT, WM_KEYDOWN, VK_RETURN, IntPtr.Zero); PostMessage(MW4EDIT, WM_KEYUP, VK_RETURN, IntPtr.Zero); //Get the console text - works and finds the correct window - cross checked with api spy IntPtr MW4TEXT = FindWindowEx(MW4CONSOLE, MW4EDIT, "Edit", IntPtr.Zero); //does not work int length = GetWindowTextLength(MW4TEXT); StringBuilder sbtext = new StringBuilder(length + 1); GetWindowText(MW4TEXT, sbtext, sbtext.Capacity); lbUserNames.Items.Add(sbtext.ToString()); }