Page 1 of 1

Selecting and reading items from popup menus

PostPosted: Thu Dec 09, 2010 3:02 am
by Mark
The app I am working with has many context sensitive (popup) menus, i.e. menus that get displayed at the cursor when I right-click on an item. The windows declaration recorder doesn't find them when I select the main window and they disappear when I switch windows so I cannot activate the popup and then try to record it.

With experimentation, I can get the coordinates to do a MouseClick, but I am wondering if there is a better way to deal with this. Some of these menus are nested 2 and 3 levels deep so that is a lot of coordinate calculating. It would be great to manage them like the normal menus.

Re: Selecting and reading items from popup menus

PostPosted: Mon Dec 13, 2010 7:48 pm
by john
Hello-

Yes, unfortunately WinDR cannot record popus since they don't exist when you leave an application. However, you can use the recorder to record a pop-up and get the coordinates:

SetDelay(200);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").MouseClick(2,753,236,1);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").MouseClick(2,753,236,2);
MainWin(1,"#32768").MouseClick(0,46,112,1);
MainWin(1,"#32768").MouseClick(0,46,112,2);

Be sure to record each selection of multi-tiered popups (don't 'hover' over a menu, but click it). Another option is to use the arrow keys or accelerators:

#Recorded Commands - 12/13/10 14:48:31
SetDelay(200);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").MouseClick(2,824,239,1);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").MouseClick(2,824,239,2);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").TypeKeys("<UP>");
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").TypeKeys("<ENTER>");

This avoids mouse click coordinates altogether...

-John

Re: Selecting and reading items from popup menus

PostPosted: Wed Dec 15, 2010 3:49 pm
by Mark
OK. Too bad about the popups, but thanks for the suggestions on getting the coordinates.