Window-Eyes has a way to marshal strings across processes, though it's
of limited usefulness and thus we didn't try to document it.
The bigger problem with this particular message is that it's a
registered message, which means it doesn't have a fixed numeric message
ID. That's something we don't have any way to support.
Chris Meredith wrote:
Greetings.
I was taking a look at the article at
http://msdn.microsoft.com/en-us/library/ms996405.aspx, which is written from
the perspective of Visual Test attempting to do the same thing. Apparently
a message does exist, WM_GETCONTROLNAME, which returns the name defined in
the code for a .NET control, providing the programmer hasn't done something
fancy like dynamically create the controls collection at runtime. My only
question is, does VBScript manage to shim Windows' lack of support for
marshalling strings across processes for SendMessage(), or does the WE
scripting model provide a way to do this? The alternative, I suppose, would
be to write a COM component to handle shared memory and work it that way, as
I don't think you can reference external functions in a DLL from VBScript,
can you?
Alternately, would it be possible to get an IDispatch * from the form
itself--perhaps by going from an hWnd to an IAccessible, then performing
some QI magic (or late binding)? I suspect that this would be dependent on
the [ComVisible] attribute in the form's definition, and I can't imagine
that being on by default, or at the very least I can't imagine COM
interfaces to forms being arbitrarily available, which would just leave the
WM_GETCONTROLNAME method as the best supported option--which brings us back
to accessing shared memory from within a VBScript.
-----Original Message-----
From: Doug Lee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 03, 2008 8:48 AM
To: [email protected]
Subject: .Net control names from a script?
Is it possible to get the variable name of a .Net form field from a
Window-Eyes script, given the field's window handle? I guess this is
a feature request if not. Since actual numeric control IDs are
dynamically assigned at runtime in .Net applications (they actually
equal the numeric value of the window handle for the control), such
variable names are often the only way of reliably identifying a field
in .Net.