Is there any better solution to check right Click on a button rather than that one? Since could be there 100`s keys to process.
Topic is about to find out what is missing in AutoIT to handle contol ID`s of right Clicked Buttons amongst bunch of buttonkeys.
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
$hGUI = GUICreate("Test", 300, 300)
GUISetOnEvent($GUI_EVENT_CLOSE, "bye")
GUISetOnEvent($GUI_EVENT_SECONDARYUP, "_SecondaryUp")
global $cButton[9]
for $x=1 to 3
$cButton[$x] = GUICtrlCreateButton("Check"&$x, 10, 10*($X*5), 80, 30)
GUICtrlSetOnEvent(-1, "_Button")
next
$x+=1
$cButton[$x] = GUICtrlCreateButton("NoCheck", 10, 10*($X*5), 80, 30)
GUISetState()
While Sleep(10)
WEnd
Func _Button()
$nTempId=GUICtrlRead(@GUI_CtrlId) ; can get ID from Left Clicked Button//
$aCInfo = GUIGetCursorInfo($hGUI)
MsgBox(0, "Pressed", "LEFT "&$nTempId&":"&GUICtrlRead($aCInfo[4]),.5)
EndFunc
Func _SecondaryUp()
$aCInfo = GUIGetCursorInfo($hGUI)
for $x=1 to 3 ; my solutionprocess slower....
If $aCInfo[4] = $cButton[$x] Then
$nTempId=GUICtrlRead(@GUI_CtrlId) ;cannot get real ID, but last one.
$nTempId2=GUICtrlRead($cButton[$x]) ;can get ID
MsgBox(0, "Pressed", "RIGHT "&$nTempId&":<=? True= "&$nTempId2,1)
EndIf
next
EndFunc
Func bye()
Exit
EndFunc