English 中文(简体)
Changing combobox value of minimized third party application via hotkey [closed]
原标题:

Closed. This question needs to be more focused. It is not currently accepting answers.


Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 5 years ago.

I have a piece of closed-source third party windows software which consists of only one window and is minimized almost all the time. I d like to be able to change the selected item of a combobox in that window via a system-wide hotkey. If possible, I d like to keep the third party app minimized in the process.

I guess this should be easy to do with Autoit or Autohotkey, but I have never used either of these tools before.

Which tool would be better suited for the job? Does anyone have any pointers on where to start? For example a link to a tutorial showing a similar scenario.

最佳回答

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
问题回答

暂无回答




相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签