I try to use the menus of the Windows Explorer in Vista but it does not work with the Menu class.
Can somebody suggest me an other way.
Peter
Menus of the Windows Explorer in Vista
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
The Menu of the Windows Explorer in Vista is a ToolBar and not a Menu control.
It has no Text and no ControlId so it's difficult to find.
Use the following code to automate the menus of the explorer:
Jenö
Ranorex Support Team
It has no Text and no ControlId so it's difficult to find.
Use the following code to automate the menus of the explorer:
Code: Select all
Form form = Application.FindFormClassName("CabinetWClass");
form.Activate();
ToolBar toolbar = null;
// Find the toolbar with the commandId = 32896 (View menu item)
foreach (Control control in form.Controls)
{
if (control.ClassName == "ToolbarWindow32")
{
toolbar = new ToolBar(control.Handle);
if (toolbar.GetItemIndex(32896) > 0)
break;
else
toolbar = null;
}
}
if (toolbar != null)
{
toolbar.ClickItem(32896); // Click the View menu item
Application.PopupMenuSelectItem("Details");
}
Ranorex Support Team