HarshChaturvedi 0 Posted October 26, 2013 Hi , I am working on a gui which involves arranging items by drag and drop. The variables respective to each item can be changed by right clicking on the item and choosing an option from the drop down menu. Now since drop down menu doesn't have a title bar how do i get hold of the sub items in the menu?? Please help guys .. Thanks in advance . Share this post Link to post Share on other sites
l3ill 70 Posted October 26, 2013 I'm just stabbing at vagueness here: To click on a drop down menu item use ControlClick Right and maneuver up & down with the arrow keys and finally enter My Contributions...SnippetBrowserNewSciTEPathFinderText File ManipulationFTP Connection Tester / INI File - Read, Write, Save & Load Example Share this post Link to post Share on other sites
Iczer 15 Posted October 26, 2013 Just right-click where you need (to make context menu appear) a then run this function: #include <WindowsConstants.au3> #include <SendMessage.au3> #include <GuiMenu.au3> Func Click_RightClickMenu($sRequired_Text = "") Local $previousMousePos, $hWnd, $hMenu, $iCount, $iIndex, $sText, $aPos, $iOldOpt $previousMousePos = MouseGetPos() If $sRequired_Text = "" Then Return SetError(1) If WinExists("[CLASS:#32768]") Then $hWnd = WinGetHandle("[CLASS:#32768]") $hMenu = _SendMessage($hWnd, $MN_GETHMENU, 0, 0) If _GUICtrlMenu_IsMenu($hMenu) Then $iCount = _GUICtrlMenu_GetItemCount($hMenu) For $iIndex = 0 To $iCount - 1 $sText = StringReplace(_GUICtrlMenu_GetItemText($hMenu, $iIndex),"&","") If $sText == $sRequired_Text Then $aPos = _GUICtrlMenu_GetItemRect($hWnd, $hMenu, $iIndex) $iOldOpt = Opt("MouseCoordMode", 0) MouseClick("primary", $aPos[0] + ($aPos[2] - $aPos[0]) / 10, $aPos[1] + ($aPos[3] - $aPos[1]) / 2, 1, 1) Opt("MouseCoordMode", $iOldOpt) EndIf Next EndIf EndIf Sleep(10) MouseMove($previousMousePos[0], $previousMousePos[1], 0) EndFunc ;==>Click_RightClickMenu Where $sRequired_Text - is the name of the menu item you want to click Share this post Link to post Share on other sites