Page 1 of 1

Detecting focus on an editable combobox

Posted: Thu Dec 04, 2003 8:58 pm
by Karbon
I find that when I use an editable combo box I can't determine focus by using

Code: Select all

if GetFocus_() = GadgetID(#my_combo)
.. I'm guessing it's because an editable combo box is a bunch of string gadgets and those are actually the gadgets with the focus? How might I see if one of those string gadgets belonging to my combo has the focus?

Thanks!

Posted: Thu Dec 04, 2003 9:56 pm
by freak
The edit control inside a combobox is it's child window, so you can get the
handle, and test like this:

Code: Select all

If GetFocus_() = GetWindow_(GadgetID(#my_combo), #GW_CHILD)
Timo

Posted: Fri Dec 05, 2003 6:34 pm
by Karbon
Awesome, thank you!