c# - SendInput not working after attaching thread input to a target process -
i'm making application needs work ui of program doesn't seem implement ui automation elements (inspect.exe shows main pane , no children). so researched best ways implement features need were, , found sendinput(), apparently newer version of keybd_event() , mouse_event(). however, since requires keyboard focus , since can't afford set target window foreground (to avoid bothering user while runs), kept searching until found this answer . did skurmedel said, , joined application's thread target's window thread. now, if setfocus() target , sendinput(), target window won't affected. my question either "why doesn't work?" or "what doing wrong?", guess code example sorting out: threadhandler class class threadhandler { #region p/invoking , constants definition const uint wm_gettext = 0x000d; [dllimport("user32.dll")] static extern intptr setfocus(intptr hwnd); [dllimport("user32.dll")]...