Posted: 9 Mar 2018 10:10 EST 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...
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
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.
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...
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?