0

Can I SendKeys to a selected window in c#?

The Program knows the window which it has to send it and the window not really necessary to be the active window. I just want to give the program window name and send into it.

EX : I type application name (notepad for example) and not really necessary to be focused Upon the meant window.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
Mr.Rye
  • 1
  • 2
  • Elaborate on your idea. I can't quite get it. Is my assumption correct? 1. Record typing input on notepad 2. Select a window and using program to simulate keyboard input, where data is record in 1.? – Louis Go Mar 16 '20 at 00:19
  • @Louis OP is saying that they want to use SendKeys with a non-active window. – ProgrammingLlama Mar 16 '20 at 00:20
  • This sounds like a P/Invoke situation. – rfmodulator Mar 16 '20 at 00:25
  • https://stackoverflow.com/questions/10013900/send-key-to-inactive-window-of-process and https://stackoverflow.com/questions/21339502/sendkeys-to-inactive-application might help. – Louis Go Mar 16 '20 at 00:33
  • @John sorry for the question actually i have already joined here – Mr.Rye Mar 16 '20 at 00:36

0 Answers0