External c# Program ComboBox

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
LifeLine
Posts: 2
Joined: 10 May 2021, 20:28

External c# Program ComboBox

10 May 2021, 20:43

I've looked around and can't find this anywhere. The docs don't have a simple example.
I've checked the message board and don't see this simple question answered. I must be doing something easy wrong.

I have a combobox on an external windows app. I've tried several things, here is the simplest which I think should work:

ControlGet, var1, Choice,,Edit1, "My Program"
msgbox, %var1%

I can't get anything to come back other than blank. It is odd because the WindowSpy program can see the value and return it with no problem... Any help would be great!


Thanks again! I hope I'm missing something easy! I can read the TextBox controls but not the ComboBox
User avatar
mikeyww
Posts: 27084
Joined: 09 Sep 2014, 18:38

Re: External c# Program ComboBox

10 May 2021, 21:12

You probably have the wrong WinTitle; see documentation.
LifeLine
Posts: 2
Joined: 10 May 2021, 20:28

Re: External c# Program ComboBox

10 May 2021, 21:31

I'm able to pull textbox controls from the same window using the same window title. I think I have it right?
User avatar
mikeyww
Posts: 27084
Joined: 09 Sep 2014, 18:38

Re: External c# Program ComboBox

11 May 2021, 06:48

Try changing Edit1 to ComboBox1. Demonstration is below.

Code: Select all

Gui, Font, s10
Gui, Add, ComboBox, vcolor gGet, Red|Green|Blue|Black|White
Gui, Show
Return
Get:
Sleep, 100
ControlGet, var1, Choice,, ComboBox1, ahk_class AutoHotkeyGUI
MsgBox, %var1%
Return
Window Spy shows the control names-- but interesting that it shows both "Edit1" and "ComboBox1" for AHK GUI, depending on the exact cursor placement.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, Bing [Bot], Chunjee, jollyjoe and 230 guests