Advertisement
Guest User

Untitled

a guest
Mar 12th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.07 KB | None | 0 0
  1. #include <GUIConstantsEx.au3>
  2. #include <Misc.au3>
  3. #include <GuiComboBox.au3>
  4.  
  5. Local $hDLL = DllOpen("user32.dll")
  6.  
  7. $Form1 = GUICreate("Form1", 310, 152, 361, 178)
  8. $Combo1 = GUICtrlCreateCombo("Combo1", 16, 64, 145, 25)
  9. GUICtrlSetData(-1, "Item1|Item2|Item3|Item4|Item5")
  10. $Label1 = GUICtrlCreateLabel("Press Alt+F TO select UP", 16, 16, 128, 17)
  11. $Label2 = GUICtrlCreateLabel("Press Alt+C TO select DOWN", 16, 40, 143, 17)
  12. GUISetState(@SW_SHOW)
  13.  
  14. While 1
  15.     $nMsg = GUIGetMsg()
  16.     Switch $nMsg
  17.         Case $GUI_EVENT_CLOSE
  18.             DllClose($hDLL)
  19.             Exit
  20.     EndSwitch
  21.     If _IsPressed(12, $hDLL) And _IsPressed(46, $hDLL) Then
  22.         $iIndex = _GUICtrlComboBox_GetCurSel($Combo1)
  23.         If $iIndex < _GUICtrlComboBox_GetCount($Combo1) - 1 Then
  24.             $iIndex += 1
  25.             $iRet = _GUICtrlComboBox_SetCurSel($Combo1, $iIndex)
  26.         EndIf
  27.         While _IsPressed(12, $hDLL) And _IsPressed(46, $hDLL)
  28.             Sleep(10)
  29.         WEnd
  30.  
  31.     ElseIf _IsPressed(12, $hDLL) And _IsPressed(43, $hDLL) Then
  32.        ; SWITCH DOWN
  33.     EndIf
  34. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement