Discussion:
Trapping characters entered into Combo box
(too old to reply)
ntman
2010-08-01 14:58:03 UTC
Permalink
I'm trying to trap and process characters as they are entered into the edit
part of a combo box. I've subclassed the ComboBox control and my new wndproc
is receiving messages. However, they are not the messages I am expecting!
When a character is entered I'm geting messages 0x111, 0x133, 0x111 and when
a <CR> is entered I'm getting message 0x157. Im not getting any WM_CHAR
messages!!! (or WM_KEYDOWN or indeed any normal keyboard messages at all).

I've also tried superclassing the ComboBox control but again I'm getting the
same messages for characters entered.

Please would some kind person provide some help as to what is going on and
how I can trap and process chars in the edit part of a combo box.

NB I can trap and process characters OK for an Edit control - it's just
ComboBox control that's causing a problem.

John.
Ivo Beltchev
2010-08-01 15:06:57 UTC
Permalink
If your combo box is a "dropdown" instead of "dropdown list", then it
has a child edit control. You can use CB_GETCOMBOBOXINFO to get the HWND
of the edit control, and then you can subclass it normally.
Post by ntman
I'm trying to trap and process characters as they are entered into the edit
part of a combo box. I've subclassed the ComboBox control and my new wndproc
is receiving messages. However, they are not the messages I am expecting!
When a character is entered I'm geting messages 0x111, 0x133, 0x111 and when
a <CR> is entered I'm getting message 0x157. Im not getting any WM_CHAR
messages!!! (or WM_KEYDOWN or indeed any normal keyboard messages at all).
I've also tried superclassing the ComboBox control but again I'm getting the
same messages for characters entered.
Please would some kind person provide some help as to what is going on and
how I can trap and process chars in the edit part of a combo box.
NB I can trap and process characters OK for an Edit control - it's just
ComboBox control that's causing a problem.
John.
Loading...