0

I can read lot of posts about problems using System.Windows.Forms.SenKeys with Windows 10.

But I can't read anything about problems using My.Computer.Keyboard.Sendkeys with Windows 10.

So the question: Keyboard.Sendkeys is a update of SendKeys, more compatible with Win 10, or is the same thing with the same problems? If I want to distribute an application using SendKeys to avoid problems is more safe to use InputSimulator? (note: on my PC with Win 10 64bit all three works without problems)

ezio
  • 394
  • 3
  • 12
  • They're essentially the same. `Forms.SendKeys` is most likely more up-to-date than `Keyboard.SendKeys`. What are these "problems" you are talking about, though? I haven't heard of any problems with either. – Visual Vincent Mar 28 '19 at 17:00
  • `Keyboard.SendKeys` calls `Forms.SendKeys` – TnTinMn Mar 28 '19 at 17:03
  • 2
    It is the **exact** same method. The My namespace was meant to make it easier for VB.NET programmers to find stuff back. The only reason that SendKeys was added to the framework is because it existed long before .NET was released. Don't use it, UI Automation is the correct way. – Hans Passant Mar 28 '19 at 17:05
  • @ Visual vincent -https://stackoverflow.com/questions/50404327/is-there-an-alternative-for-the-sendkeys-class-that-will-work-with-windows-10 – ezio Mar 28 '19 at 18:37
  • @Hans Passant -I can't import System.Windows.Automation... may be because my application is a Windows.Forms one? – ezio Mar 28 '19 at 18:51
  • 1
    You've got to import the automation libraries first (`Project > Add Reference`). See the answer to the following question: https://stackoverflow.com/q/22551669 – Visual Vincent Mar 28 '19 at 23:24

0 Answers0