Ranorex

Please tell the code to access a menu item

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexCore
View previous topic :: View next topic  
Author Message
deepa



Joined: 19 Sep 2006
Posts: 1

PostPosted: Tue Sep 19, 2006 7:35 am    Post subject: Please tell the code to access a menu item
I am using VC++ to test my application but I am not able to capture the menu bar,I tried givining the handle of main window of my application,Also I tried giving the control name that I captured using Ranorexspy.Please help its urgent Sad ...I need to test access all the menu items
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Thu Sep 21, 2006 1:15 am    Post subject:
If your menu bar has a control name, than it's a menü strip (like in the RanorexVS2005Sample).
You can find and use a menu strip in C++ as follows:

Code: click into code to enlarge
HWND menuStrip = RxFormFindChildControlName(form, "menuStrip1");
if ( menuStrip == 0)
{
    printf(" ERROR: MenuStrip not found\n");
    exit(2);
}

printf(" menuStrip=%d\n", menuStrip);

RxMouseMoveToControl(menuStrip);

ret = RxMenuSelectPosition(menuStrip, 1, 1);
...
ret = RxMenuSelectPosition(menuStrip, 2, 3, 2);
...
ret = RxMenuSelectItemText(form, "Submenu1", "Submenu1Item3", "Subitem2");   

Jenö Herget
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexCore All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum