value of wParam with OnCommand()

value of wParam with OnCommand()

Post by Stanislas » Fri, 26 Nov 2004 23:20:55


Hi,

I'm using VC++ 6.0 on windows 2000.
I've made a dialog with a CCheckListBox in it.
I want to get informed each time a check value is changed.
As there is no built-in OnChecked() method, I've overriden
OnCommand(WPARAM wParam, LPARAM lParam).

The method is correctly called when I click on my CCheckListBox control.
I began to filter the messages with LOWORD(wParam).
But I've found that OnCommand is sometimes called for another reason.
In the de *** I've found that there these values :
4 on initialization
40 when clicked
5 when the CCheckListBox is modified by code associated to another
control
4 and then 40, sometimes, not sure exactly when, but not related to a
click.

Well, I now filter the message for LOWORD(wParam) == ID_MY_CONTROL
AND HIWORD(wParam) == 40.

I've not found documentation about these values of HIWORD(wParam).
Where could I find that ?
MSDN only informs me about values 0 and 1.
If there is no documentation, perhaps somewhere in a piece of source
code I could find some useful #defines ?

Is the way I filter messages correct (in the MFC way I mean) ?
And isn't there a better way to get informed immediately of changes
of checks in a CCheckedListBox control (it works, but looks...ugly) ?

regards
--
Stanislas RENAN
 
 
 

value of wParam with OnCommand()

Post by Norman Bul » Sat, 27 Nov 2004 00:27:19


Look at the documentation for each of the standard controls (button,
edit, combobox, etc.) All of them have a list of notifications that may
be sent to you in the form of WM_COMMAND messages.

The notification codes start with BN_xxx, EN_xxx, CBN_xxx.

Norm

--

 
 
 

value of wParam with OnCommand()

Post by Jeff Partc » Sat, 27 Nov 2004 00:39:50


// Check Listbox Notification codes
#define CLBN_CHKCHANGE (40)
#define ON_CLBN_CHKCHANGE(id, memberFxn) \
ON_CONTROL(CLBN_CHKCHANGE, id, memberFxn)

http://www.yqcomputer.com/ %3Ben-us%3B214478

--
Jeff Partch [VC++ MVP]
 
 
 

value of wParam with OnCommand()

Post by Stanislas » Sat, 27 Nov 2004 02:10:30

Norman Bullen a rit :
I did read the documentation before posting...

The message is undocumented according to Jeff's link.

regards,
--
Stanislas RENAN
 
 
 

value of wParam with OnCommand()

Post by Stanislas » Sat, 27 Nov 2004 02:10:33

Jeff Partch [MVP] a rit :

thanks a lot for the link !

--
Stanislas RENAN