Would appreciate if someone could point me to code sample for how I determine which textfield on a window has the focus.
I’m writing some code (using the available examples) for copying selected text to the clipboard and then pasting it somewhere. I need the code to be “generic”, meaning, it should know which control (textfield) has the focus so it will pick up the selected text from that field and paste it elsewhere, regardless of the actual name of the control.
In other words, the sample shows it referencing a specific textfield but I want it to work for whichever textfield has the focus.