0

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:

enter image description here

Jonesopolis
  • 25,034
  • 12
  • 68
  • 112
  • Have you considered using pipes or one of the other built-in IPC mechanisms? – rory.ap Jan 20 '15 at 14:40
  • Ok, maybe I forgot to add that programming is only a sub task at my company and this is the first approach for automatisation. Can you maybe elaborate on that? –  Jan 20 '15 at 14:42
  • Read about [IPC in general](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574%28v=vs.85%29.aspx), and then read about [IPC in .NET](http://stackoverflow.com/questions/56121/ipc-mechanisms-in-c-sharp-usage-and-best-practices). – rory.ap Jan 20 '15 at 14:44
  • Does HPSM not have an API that you can integrate with? – Steve Jan 20 '15 at 15:11
  • Thanks for your reply. It seems like there is an API [https://www.youtube.com/watch?v=gV8mqcVoN4A] but it is not available for download. At least not for free. –  Jan 22 '15 at 14:06

0 Answers0