Ricks Place wrote:
In Audition and a couple of others they seem to be connecting to the running application by connecting to some of it's MSAA Events I guess. In the Audition script they seem to be using a variable called accObject as a reference to something in the Running Application. First, where are they getting the reference and defining the accObject variable value?

The variable name accObj doesn't mean anything itself. I could have used myFavoriteVariableName. The data that variable contains depends on the event that called the function.

For example, you'll note around line 266:

ConnectEvent(myMSAAEventSource, "OnObjectFocus", "OnObjectFocus")

That says, in a nutshell, "Watch for MSAA focus events, and when one happens, call the custom routine OnObjectFocus." I tend to use the name of the event as the name of my event handler to keep things easy to find.

You can tell from the documentation for the OnObjectFocus event that a single parameter (an Accessible object) will be passed to the event handler (i.e. the OnObjectFocus subroutine). In my OnObjectFocus routine, I chose to name that parameter accObj, which is short (in my mind) for accessible object. I use that variable name often because it helps me remember that the data being passed to my event handler is an Accessible object.

Second, I want to set and change properties in a DataGridView in the Running Application
That means modify the existing instance of the control
So, how do I get a reference to the control so I can access it's properties and methods?

You can get a Control object for a window by calling that window's Control method. The DataGrid objects are not standard controls, so you're not going to be able to do anything with them through the Window-Eyes Control object interface. Supported controls are listed in the documentation as:

CheckBox
ComboBox
EditBox
GroupBox
ListBox
ListView
ProgressBar
PushButton
RadioButton
Static
TabControl
TrackBar
TreeView
UpDown

In VBS I think the Create or GetObject would be used but what about in Windoweyes?
I do not see anything like that in several GW scripts I looked at.

Both CreateObject and GetObject are used throughout our scripts. Perhaps more detail about what you're looking for would be helpful.

The closest thing in the Audition Script seems to be a variable they call accObject. Where do the define that variable and where do they load it's value with a CreateObject or GetObject or even just create a new instance with the New keyword or what?

The accObj parameter discussed above doesn't have anything to do with GetObject.

I've spent days trying to figure this stuff out, no books, no documentation other than cryptic object definitions and scripts that don't seem to follow the VBScript as I have read up on in the MS manuals.

Here, again, is where more detail would be helpful. What exactly are you looking for?

Also, I found one of the commands ConnectEvent. Not a command nor subroutine but a method under the Script Object. But, you would never know that as there is no object where the method is being applied. It should be MyScript.ConnectEvent(Whatever)
Or something like that.

The Script object is a root object, just like Application. You can call ConnectEvent (and other script methods) directly.

Also, the ConnectObject talks about connecting multiple events, what? Doesn't the ConnectObject Method, if that is what they want to call it, suppose to, well, connect an Object?

ConnectEvent allows you to hook a single event. ConnectObject allows you to hook multiple events using a single call.

For example, I could do:

ConnectEvent MSAAEventSource, "OnObjectFocus", "MyFocusRoutine"
ConnectEvent MSAAEventSource, "OnObjectNameChange", "MyNameChangeRoutine"
ConnectEvent MSAAEventSource, "OnObjectStateChange", "MyStateChangeRoutine"

with the corresponding subs:

Sub MyFocusRotine(obj)
End Sub

Sub MyNameChangeRoutine(obj)
End Sub

Sub MyStateChangeRoutine(obj)
End Sub

or, using ConnectObject, I could do:

ConnectObject MSAAEventSource, "myMSAA_"

Sub myMSAA_OnObjectFocus(obj)
End Sub

Sub myMSAA_OnObjectNameChange(obj)
End Sub

Sub myMSAA_OnObjectStateChange(obj)
End Sub

With ConnectObject, you specify a function name prefix, and then you can access any of the object's events using that prefix plus the event name (as demonstrated above).

So, anyway, if you know where they define the accObject, where they it's value and if that is some object running in the Running Application could you let me know?

As mentioned, accObj is a variable that references the Accessible object passed through an MSAA event handler.

One more thing, what is an Overlp? From what I learned it was something on a screen overlapping another item, here it looks like they mean the Running Application. Is this the case?

An overlap window is typically a window that contains a title bar and border.

Aaron

--
To insure that you receive proper support, please include all past
correspondence (where applicable), and any relevant information
pertinent to your situation when submitting a problem report to the GW
Micro Technical Support Team.

Aaron Smith
GW Micro
Phone: 260/489-3671
Fax: 260/489-2608
WWW: http://www.gwmicro.com
FTP: ftp://ftp.gwmicro.com
Technical Support & Web Development


__________ Information from ESET NOD32 Antivirus, version of virus signature 
database 3886 (20090224) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


Reply via email to