Guest User

Untitled

a guest
Feb 8th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.52 KB | None | 0 0
  1. #include <GUIConstants.au3>
  2.  
  3. $hGUI = GUICreate("Test-GUI",300,300)
  4. $hLabel = GUICtrlCreateLabel("",50,50,200,200)
  5. GUICtrlSetBkColor($hLabel,0xFF0000)
  6.  
  7. GUISetState()
  8.  
  9. While 1
  10.     $aMsg = GUIGetMsg(1)
  11.     Switch $aMsg[0]
  12.         Case -3
  13.             Exit
  14.         Case $GUI_EVENT_PRIMARYDOWN
  15.             $aCursor = GUIGetCursorInfo()
  16.             If $aCursor[4] = $hLabel Then GUICtrlSetBkColor($hLabel,0x0000FF)
  17.         Case $GUI_EVENT_PRIMARYUP
  18.             $aCursor = GUIGetCursorInfo()
  19.             If $aCursor[4] = $hLabel Then GUICtrlSetBkColor($hLabel,0xFF0000)
  20.     EndSwitch
  21. WEnd
Add Comment
Please, Sign In to add comment