Hello to all,
I have this script:
Work fine with 1 button, not with 2 or more, maybe is the flag but i don't know how to set it in the func. Thanks for any help
I have this script:
[ autoit ]
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $Flag = False $Form1 = GUICreate("Form1", 243, 141, 196, 128) $Button1 = GUICtrlCreateButton("Normal_1", 8, 8, 73, 33) $Button2 = GUICtrlCreateButton("Normal_2", 7, 51, 73, 33) $Button3 = GUICtrlCreateButton("Normal_3", 7, 95, 73, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch My_Mouse_Is_Hover($Button1, "1") ;~ My_Mouse_Is_Hover($Button2, "2") ;~ My_Mouse_Is_Hover($Button3, "3") WEnd Func My_Mouse_Is_Hover($handle, $data) $nHover = GUIGetCursorInfo() If $nHover[4] = $handle Then If Not $Flag Then GUICtrlSetData($handle, "I'm cool") $Flag = 1 EndIf Else If $Flag Then GUICtrlSetData($handle, "Normal_" & $data) $Flag = 0 EndIf EndIf EndFunc ;==>My_Mouse_Is_Hover
Work fine with 1 button, not with 2 or more, maybe is the flag but i don't know how to set it in the func. Thanks for any help