The control ToolStrip is new in Visual Studio 2005 and it does not exists in earlier windows versions. If the class name of your control is "ToolbarWindow32", then you have a Toolbar and not a ToolStrip, a ToolStrip has always a Control name and a Class name (WindowsForms10.Windows.8.app...).
The RxToolStrip functions in V0.9.4 work only with ToolStrips, you can automate the elements of a Toolbar in 0.9.4 as follows:
Code: click into code to enlarge
// Click the Toolbar button with the name 'Open'
ElementStruct element;
if ( RxControlGetElement(hWndToolbar, &element) == TRUE)
{
// Find and click the toolbar item with the name 'Open'
ElementStruct toolBarItem;
if ( RxElementFindChild(&element, ROLE_SYSTEM_PUSHBUTTON, "Open", NULL, &toolBarItem) == TRUE )
RxMouseClickElement(&toolBarItem);
}
You will be able to use the RxToolStrip functions also for a Toolbar in V0.9.5, i uploaded the first Beta to try:
http://www.ranorex.com/download/RanorexCore-0.9.5-Beta1.zip
You can use the functions as follows:
Code: click into code to enlarge
RxToolStripSelectItemText(hWndToolbar, "Edit", NULL); // please use a NULL as last argument
RxToolStripSelectPosition(hWndToolbar, 1);
...
Jenö Herget
Ranorex Team |