Question
RBC
CA
Last activity: 7 Feb 2019 5:39 EST
Working with unknown Windows controls. Can I pass to a script
I'm attempting to work with an old Windows Application (VB6) and during the interrogation I'm finding a number of controls that the studio can't work with( Ex: msflexgrid.ocx) Studio can recognize the control as something, but provides no methods for it. Separately I have a C# script that can work with the control and translate it into usable data, but studio doesn't seem to be able to pass me the generic control.
My company has a support ticket open to get a custom adapter built, but want to know if there is an easier/generic way to simply pass the control on to a script for it to figure out what to do with it...
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
How are you trying to pass the control to the script? You should at least be able to pass it as an object (script parameter set to object) and cast it inside of your script.
RBC
CA
hey Jeff,
I wrote a test function (below):
static public string TellMeAbout (object obj)
{
string itisA = obj.ToString();
return itisA;
}
The function is passed the 'this' property of the interrogated control. It says the object is "asxMSFlexGrid1 [OpenSpan.Adapers.Controls.Control]". Viewing it in the debugger I could not find a property that I could drill in on..
Attached is the automation I called the function with, and the interrogated control from a sample sln
any suggestions are welcomed.
Pegasystems Inc.
US
A OpenSpan.Adapters.Controls.Control will not have any methods for you to work with the object, it is pretty generic. What you might try to do is access the Target object of the control - this is the actual control. If you cast it to the correct type you may be able to do something in the script.
RBC
CA
I can see a TargetName in the properties, but not the Target object? How/where would it see this? Sounds close to want we need....
Pegasystems Inc.
US
You can refer to it in a script. For instance, here is a small script to take a Control and cast it to get the window handle.
RBC
CA
Thanks Jeff. This looks like the right answer, yet can't make it work yet. The handle showed as null, but have had to divert attention to other issues. Will research more when time permits. FYI: A (bad) work-around is currently in place to avoid the challenge...
RBC
CA
Hi Jeff
I have a similar problem, I have to read the menu items of the ComboBox, thats identified as a control.I could not interrogate it using the Bull's eye pointer, but created the control from "List Windows" tab.
I had passed the control to the Script but I am unable to read the list of menu Items from that control. Can you please suggest how to do this?
I have used your script above and got the Handle.But I not getting Windows control , its returning NULL. How Do I get the MenuItems?
Pegasystems Inc.
IN
Hi,
Please continue the conversation in the original thread here- https://collaborate.pega.com/question/interrogating-old-windows-app
Thanks!