ToolStrip functions have bugs? Ranorex-0.9.4

Class library usage, coding and language questions.
Posts: 2
Joined: Tue Oct 17, 2006 8:31 am

ToolStrip functions have bugs? Ranorex-0.9.4

Post by JohnsonFeng » Wed Oct 18, 2006 8:38 am

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

Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by webops » Wed Oct 18, 2006 9:46 pm

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 (

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 )
You will be able to use the RxToolStrip functions also for a Toolbar in V0.9.5, i uploaded the first Beta to try: ...

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