I use ToolStrip functions to operate the toolbar (toolStrip) , and find that
it thows exception because of memory access error(ox0000) , why?
How to test toolBar? Thank you!
my test code as follows:
HWND hWndToolbar = RxFormFindChildClassName(form, "ToolbarWindow32");
if ( hWndToolbar == 0)
{
TRACE(" ERROR: tool bar not found\n");
}
RxToolStripSelectItemText(hWndToolbar, "Edit"); //throws exception during execution. While debuging, it work well. memory access error. why?
RxToolStripSelectPosition(hWndToolbar, 1); //always throws exception. memory access error
ToolStrip functions have bugs? Ranorex-0.9.4
-
- Posts: 2
- Joined: Tue Oct 17, 2006 8:31 am
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:
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/Ranorex ... -Beta1.zip
You can use the functions as follows:
Jenö Herget
Ranorex Team
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: Select all
// 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);
}
http://www.ranorex.com/download/Ranorex ... -Beta1.zip
You can use the functions as follows:
Code: Select all
RxToolStripSelectItemText(hWndToolbar, "Edit", NULL); // please use a NULL as last argument
RxToolStripSelectPosition(hWndToolbar, 1);
...
Jenö Herget
Ranorex Team