Search code examples
c#winformssendkeys

How do i send a set of keys to my program to implement using code only no keyboard C#?


How do i implement a set of keys that have been sent to me by another program , for example (Alt & F4) or any other wanted sequence ? , Thanks in Advance :)


Solution

  • Thanks to every one Turned out ,C# makes available a static class to do this:

    SendKeys.Send("ABC");
    

    this will send to the top most form ABC and for more keys check this link

    http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send.aspx