RunTimeID Property Issue

While trying to setting the RunTimeIdProperty in the PropertyCondition, the following error is thrown.

How can one set this property ?

PropertyCondition value for property 'AutomationElementIdentifiers.RuntimeIdProperty' must be 'Int32[]'.

<snip>

PropertyCondition addCondtion =newPropertyCondition(AutomationElement.RuntimeIdProperty,ControlType.TreeItem);

<snip>

~JK

[731 byte] By [jayakhanna] at [2007-12-30]
# 1

RuntimeId is not a control type; it is an identifier for the UI element. It is an array of integers generated by the UI Automation system to ensure that the ID is unique on the desktop. You can get the runtime ID for a known element by calling AutomationElement.GetRuntimeId.

If you are trying to search for all TreeItems, you need to base the condition on AutomationElement.ControlTypeProperty.

PeterDonnelly-MSFTUE at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Microsoft UI Automation...
# 2

Thanks for your reply

I already figured that out. Didn't notice the UI Spy earlier at runtime

~JK

jayakhanna at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Microsoft UI Automation...
# 3

How can I create a Control Instance using AutomationElement.GetRunTimeID().

As AutomationElement.GetRunTimeID() returns array of int.

Also can this be used as handle to create object using System.Windows.Forms.Control.FromHandle.

Thanks in Advance.

Ajit

Ajit_C#1 at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Microsoft UI Automation...
# 4
No, GetRuntimeId is used only for comparing AutomationElement objects to see if they represent the same element.
PeterDonnelly-MSFTUE at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Microsoft UI Automation...
# 5

Thanks for the reply.

Do you have any example link showing how to implement ClientSide Provider for windows application.I have go through the article for menu strip, but that did'nt help much.

Ajit_C#1 at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Microsoft UI Automation...

Software Development for Windows Vista

Site Classified