for several days now I am trying to create a program that reads and writes values from/to textboxes in another application. To be more specific: I want to auto-update ticket cathegories in HP Service Manager.
My first attempt was using SendKeys. But I faced the problem that this method seems to be not really reliable as I need to reach text fields far from another and using loops that sended TAB was unreliable [of course I added an Application.DoEvents() and a Thread.Sleep]. After some time of testing I am now unable to control HPSM at all [SendKeys get executed on every program EXCEPT HPSM]. Dunno what is wrong but I read in the internet that there are several problems [only works with Visual Studio running, only while debugging etc.] so I dropped this solution.
I would welcome it if I can access the desired text fields directly. Now, using Spy++ I can select the desired text fields. But unfortunately, there is no fixed value to identify a certain text field: No way to do this programmatically.
The only thing that always seems to stay the same is the structure/hierarchy of the "Windows" provided by HPSM [see attached screenshot]. Now my idea: Is there a way to iterate through those sub-windows and read/modify the "Window Caption" portion of the certain window? Or is there another, maybe simpler way to get this sucker automated?
Thanks in advance for every help since I slowly drown in desperation :)
HPSM structure: