HotKeySet("{ESC}", "_Exit")
HotKeySet("^{z}", "_SetItem1")
HotKeySet("^{x}", "_SetItem2")
HotKeySet("^{c}", "_SetItem3")
;Set up a quick GUI for us to play with.
$gui = GUICreate("Test GUI", 150, 150, -1, -1)
GUICtrlCreateCombo("", 10, 50, 130)
GUICtrlSetData(-1, "Item1|Item2|Item3", "Item1")
GUISetState(@SW_SHOW)
While 1
; Just to keep things running
WEnd
Func _SetItem1()
ControlSend ( "Test GUI", "", "ComboBox1", "{up}{up}{up}" )
EndFunc ;==>_SetItem1
Func _SetItem2()
ControlSend ( "Test GUI", "", "ComboBox1", "{up}{up}{up}{down}" )
EndFunc ;==>_SetItem1
Func _SetItem3()
ControlSend ( "Test GUI", "", "ComboBox1", "{up}{up}{up}{down}{down}" )
EndFunc ;==>_SetItem1
Func _Exit()
Exit
EndFunc ;==>_Exit
I wrote you a small example of how you could do this. For some reason I used a GUI I build in code. I will see about putting another example in that manipulates a GUI not created in the script.
AutoIt Code...
HotKeySet("{ESC}", "_Exit")
HotKeySet("^{z}", "_SetItem1")
HotKeySet("^{x}", "_SetItem2")
HotKeySet("^{c}", "_SetItem3")
;Set up a quick GUI for us to play with.
$gui = GUICreate("Test GUI", 150, 150, -1, -1)
GUICtrlCreateCombo("", 10, 50, 130)
GUICtrlSetData(-1, "Item1|Item2|Item3", "Item1")
GUISetState(@SW_SHOW)
While 1
; Just to keep things running
WEnd
Func _SetItem1()
ControlSend ( "Test GUI", "", "ComboBox1", "{up}{up}{up}" )
EndFunc ;==>_SetItem1
Func _SetItem2()
ControlSend ( "Test GUI", "", "ComboBox1", "{up}{up}{up}{down}" )
EndFunc ;==>_SetItem1
Func _SetItem3()
ControlSend ( "Test GUI", "", "ComboBox1", "{up}{up}{up}{down}{down}" )
EndFunc ;==>_SetItem1
Func _Exit()
Exit
EndFunc ;==>_Exit
发布评论
评论(1)
我写了一个小例子来说明如何做到这一点。由于某种原因,我使用了在代码中构建的 GUI。我将看到如何放置另一个示例来操作未在脚本中创建的 GUI。
自动代码...
I wrote you a small example of how you could do this. For some reason I used a GUI I build in code. I will see about putting another example in that manipulates a GUI not created in the script.
AutoIt Code...