Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.14 KB | None | 0 0
  1. #include <ButtonConstants.au3>
  2. #include <EditConstants.au3>
  3. #include <GUIConstantsEx.au3>
  4. #include <WindowsConstants.au3>
  5. #include <WinAPI.au3>
  6.  
  7. Dim $aItems[4] = ["", "Hi", "Wie gehts?", "Tschüss"]
  8. Dim $iOld = 0
  9.  
  10. ;The UpClick and DownClick Events
  11.  
  12. $hIems = GUICreate("Test", 259, 138, -1, -1)
  13. GUISetFont(12, 400, 0, "Arial")
  14. $Button1 = GUICtrlCreateButton("Button1", 16, 56, 64, 64)
  15. $Title = GUICtrlCreateInput("1", 16, 16, 233, 26)
  16. $Arrow = GUICtrlCreateUpdown($Title)
  17. GUICtrlSetLimit($Arrow, 3, 1)
  18. $Button2 = GUICtrlCreateButton("Button2", 96, 56, 64, 64)
  19. $Button3 = GUICtrlCreateButton("Button3", 176, 56, 64, 64)
  20. GUISetState(@SW_SHOW)
  21.  
  22. GUIRegisterMsg($WM_COMMAND, "_MY_WM_COMMAND")
  23.  
  24. While 1
  25.     $nMsg = GUIGetMsg()
  26.     Switch $nMsg
  27.         Case -3
  28.             Exit
  29. ;~      Case $Arrow
  30.     EndSwitch
  31. WEnd
  32.  
  33. Func _MY_WM_COMMAND($hWnd, $nMsg, $wParam, $lParam)
  34.     $iValue = GUICtrlRead(BitAND($wParam, 0xFFFF), 1)
  35.     If $iValue <> $iOld Then
  36.         $Cmp = StringCompare($iValue, $iOld)
  37.         If $Cmp > 0 Then
  38.             GUICtrlSetData($Title, $aItems[$iValue])
  39.             $iOld = $iValue
  40.         Else
  41.             GUICtrlSetData($Title, $aItems[$iValue])
  42.             $iOld = $iValue
  43.         EndIf
  44.     EndIf
  45. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement