the statement which creates the combo-box (which I've
verified as working) is as follows: (Although note I haven't
included the code - also verified as working - which
sub-classes the control:)
> CreateWindow("ComboBox", "",
> WS_VISIBLE | WS_CHILD,
> x, y, cx, cy, wnd, (HMENU)
> 0, GetWindowLong(wnd,
> GWL_HINSTANCE), NULL);
Where "x", ""y, "cx" and "cy" are the position,
width and height of the control, respectively, and
"wnd" is the control's parent.
Trouble is, in my subclassed combo-box's "WM_COMMAND"
message handler I found that the high-word of "wParam" (which
should contain the identifier of the control that sent the
"CBN_SELENDOK" message: namely - if things are working
as I want them to - zero), is actually instead decimal 1000,
which stuffs up lots of other code which depends on the ID being
correct
I'm guessing that at least part of my problem is that my
combo-box control's window procedure is trying to handle a
"CBN_SELENDOK" message sent by itself, when a
combo-box choice is made, rather than to whichever
window the message is sent when this occurs:
Is this guess even on the right track?. Could anyone tell me
the window to which the "CBN_SELENDOK"
"WM_COMMAND" message is sent? (I.e. if this was a
"WM_NOTIFY" message, MSDN tells me the message
would be sent to the window's parent, but it doesn't seem
to tell me where it's sent in the case of "WM_COMMAND"
- unless I just haven't looked hard enough).
but if I'm barking up the wring tree: what else could be
going wrong?
Thanks,
Russell
the LOWORD of wParam is the control-id
the HIWORD of wParam is the nodification code (ie. CBN_xxx message )
lParam is the window-handle to the control
James
--
www.catch22.net
Free win32 software, sourcecode and tutorials
"Russell Potter" <russellpotter AT optusnet DOTcom DOT au> wrote in message
news:43754bfc$0$23947$afc3...@news.optusnet.com.au...
> the LOWORD of wParam is the control-id
> the HIWORD of wParam is the nodification code (ie. CBN_xxx message )
> lParam is the window-handle to the control
I checked my code more carefully and found I had actually
correctly checked the low-word of "wParam" for the ID of
sender.
I must have typed "high-word"in my haste without first
checking to the appropriate extent
My apologies,
Russell
Look for the WM_COMMAND messages that you want to handle being sent to
the parent of the COMBOBOX, the window the handle of which is in wnd
when you call CreateWindow(). You don't need to subclass the COMBOBOX to
get these messages.
Norm
--
--
To reply, change domain to an adult feline.