I'm trying to write software that is capable of performing data entry into a third party application.
I can detect the presence of windows on the screen by reference to their title by using GetOpenedWindow()
etc, focus the window and then inject keystrokes using SendKeys.SendWait("...")
etc.
However, depending on what's being entered, the behaviour of the receiving application is not consistent and there's no way to determine how it would behave in advance. In particular, the form I want to fill has a number of fields. Depending upon what is entered, you might need to "press" enter/tab a different number of times to find your way to the right field.
It's therefore not possible simply to have a pre-determined set of keys that need to be sent. Rather, my software will need to be able to interact with the third party software by knowing which control on the third party form is active at a particular time.
i.e. I need to be able to determine where the caret is on a form in third party software, or even better move it to a specific control on the form directly.
Is this even possible please?
I'm using C# .NET in MS Visual Studio 2017.