Author Topic: cWndBySeq issue  (Read 2419 times)

twb

  • Newbie
  • *
  • Posts: 8
cWndBySeq issue
« on: October 20, 2016, 09:45:04 am »
One of our uses for Winbatch is automating the running and auto-filling in values of some programs from a third party system.
In their latest release they have modified some of the screens to not be just plain text type of screens.

Our scripts were not written by me but the person that wrote them no longer works here so I have been tasked with modifying the screen entry section of the scripts that have now broke with this latest release of the software.

Using the information from this support site I have figured out how to use the Analysis tool to print the underlying screen data.  Thank you for that article.

So far I have only had to change the Parent/Child positions to set the cWndBySeq values.
But this latest screen looks more like a real windows type of screen rather than a 'green' screen look. This package was initially written in Micro-Focus COBOL but I think they are now moving towards .Net.

Now to my question.
The previous version of the screen when running the Analysis tool shows Class name of "WindowsForms10.EDIT.app.0.39daee5_r27_ad2" and could be positoned to with cWndBySeq.

New version of screen has a Class name of "HwndWrapper[Trizetto.QicLinX.QicWin.exe;;d03b7b6c-507c-4b2a-a49a-e47e2f007e47] ".

How can I position the cursor to that type of entry field?  cWndBySeq is not working.

I think the original author used cWndBySeq because that is the only unique values that are consistant when I run the Analysis tool.  The ID column changes values, I don't know what causes that unless it is based on what other applications are open in the environment.

Thank you,
Thomas Bishop
 

td

  • Tech Support
  • *****
  • Posts: 2725
    • WinBatch
Re: cWndBySeq issue
« Reply #1 on: October 20, 2016, 10:39:24 am »
Without having access to the application in question it is difficult to provide a definitive solution.  You perform a little trial and error with different sequence numbers until you find one that works.   You can also read up on the other Control Manager extender 'cWndBy' functions and perhaps perform a little trial and error with any that look promising.

WinBatch ships with the RoboScripter tool that can sometimes automate writing Control Manager based scripts.  Drag the target to your child window making sure you have checked the 'Verbose' mode under the 'Options' button after you start the tool but before you drag. 
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates

twb

  • Newbie
  • *
  • Posts: 8
Re: cWndBySeq issue
« Reply #2 on: October 20, 2016, 12:09:29 pm »
I appreciate the quick response.
I have tried several different sequence numbers based on the Parent/Child levels. I have successfully been able to modify other screens by using the Analysis tool to get the new Parent/Child numbers.

The current screen has the word 'EDIT' in the class name as shown here:
"WindowsForms10.EDIT.app.0.39daee5_r27_ad2"  and has Parent/Child of 0,8,1,2.

But the new screen does not have the word 'EDIT' embedded:
"HwndWrapper[Trizetto.QicLinX.QicWin.exe;;d03b7b6c-507c-4b2a-a49a-e47e2f007e47] " and has Parent/Child of 0,8,1,1,1 .

So I am thinking maybe I can no longer automatically enter characters into the screen prompt since it is not recognized as an 'EDIT' class.

The other cWndBy options will not work as there is not a unique value to use.

I am coding the Winbatch Scripts on my laptop but the software package is on a remote server. I don't think I will have authority to install Roboscripter on the remote server and it can take months, if not years, to get software approved for installation.  It looks to me like even if I didn't use the Roboscript generated script it may reveal how to code the prompt field in the Winbatch script so I will try to get it installed on the test server.


td

  • Tech Support
  • *****
  • Posts: 2725
    • WinBatch
Re: cWndBySeq issue
« Reply #3 on: October 20, 2016, 01:14:10 pm »
With regard to the cWndBy functions, they can be used in combination with other Control Manger functions to cycle through child windows to establish a unique identity by a combination of several properties instead of just one.   This approach is somewhat similar to how the cWndByWndSpec function works.

Also note that RoboScripter is not a stand-alone product so it expects WinBatch to be installed on the system. 
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates

twb

  • Newbie
  • *
  • Posts: 8
Re: cWndBySeq issue
« Reply #4 on: October 24, 2016, 07:45:36 am »
I might have found a solution.
The 3rd party software company provides a DLL file for accessing their screens. I'm not yet sure what all the DLL provides but one team within our company uses the DLL in .Net applications to locate positions on the screen to autofill screen prompts. Same thing our Winbatch scripts do except the Winbatch scripts are more complex than the .Net applications. Our Winbatch scripts perform FTP to receive a file, rename it, archive it, call the program EXE, sometimes more than 1 EXE, retrieve results via SQL, and email or FTP data back.

I saw a few examples on the Winbatch support site on using 3rd party DLL's from within Winbatch scripts.
I have asked for a copy of the DLL so I can experiment with it.

td

  • Tech Support
  • *****
  • Posts: 2725
    • WinBatch
Re: cWndBySeq issue
« Reply #5 on: October 24, 2016, 08:55:59 am »
If the DLL is a .Net assembly, you will likely be able to use WinBatch CLR hosting to access the class members implemented in the DLL.  If the DLL exports native entry points to its functionality, DllCall is your friend.  If it is/does both, you can take your pick.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates