Detecting focus on an editable combobox

Windows specific forum
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Detecting focus on an editable combobox

Post 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!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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
quidquid Latine dictum sit altum videtur
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Awesome, thank you!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Post Reply