winapi - C# about sending simulated keyboard events to another APP -


    private void button3_click(object sender, eventargs e)     {             setforegroundwindow(wndhandle);             sendkeys.sendwait("123");     } 

i use win32 api ,use sendkey achieve target,but using sendkey has disadvantage "i have setforegroundwindow() before use sendkey",it doesn't match wish.

i want click button in gui c# created, , simulate keyboard event app, , important of all, wish don't have set window of app ground window.

does have idea how it? appreciate much.

does target application must active?


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -