Reputation: 5637
Is there anyway to get any focus input (textBox) on any screen any app that active in the windows??
I want to create console application that read RFID tag and put the value (result) on any input box
that is focusing. please advise. Is it possible?
Upvotes: 0
Views: 999
Reputation: 65544
You can use this method to Send Keys to the other applications textbox: C# using Sendkey function to send a key to another application
Upvotes: 1
Reputation: 510
You can check to see if any form is active in your windows application. If form is active, then you can check which TextBox in the form has focus:
FormCollection fc = Application.OpenForms;
foreach (Form frm in fc)
{
if (frm != null)
{
foreach (TextBox txt in frm.Controls)
{
if (txt.Focused)
{
txt.Text = "your text";
}
}
}
}
Upvotes: 0