how to prevent focus changing?
Posted on 2002-06-18
I have a Delphi app with a single edit control on a form.
I have second app with a single button on it.
I set the input focus to the edit control. When I click the button, I want to put "A" (or whatever) in the edit box.
This is easy to do, except:
I don't want the edit control to lose focus,
and I may have multiple apps with edit controls running, or a form may have multiple edit controls on it.
In any case, the app with the button needs to send the "A" to the edit control that has focus (assume an edit control always has the focus when the button is pressed), regardless of which form or application it resides in.
At runtime, I don't know or care about window titles, appnames or whatever. I just want to send a keystroke to the focused edit control, and leave it focused.