Listview control-check boxes

Listview control-check boxes

I am able to check the checkboxes if I do the following:
ret = SendMessage (hwndlist, LVM_SETITEMSTATE,

and uncheck them by setting lvi%state to 0.
But this is different from what has been given in help for the state parameter.

In Help they have asked us to use a value for the state member to be the one-based index of the state image shifted left 12 bits. What is this one-based index of the state image?. The stateimage index value is 2 in my case because that index when shifted by 12 bits results in 8192(the value I've used to check the check boxes).But how will zero cause them to be unchecked again?
If someone can provide me help it'll be great.Thanks,

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The images to be shown in the control are stored in an image list, which is 1-based. The first image is shown when the control (checkbox, in your case) has the focus (LVIS_FOCUSED), and the second one is the one you see, when it is selected. I suppose you want to use predefined parameters (LVIS_SELECTED) and INDEXTOSTATEIMAGEMASK to obtain the shifted state value. See
(all in one line) for more details.

Greg Chien

Leave a Comment

Please sign in to add a comment. Not a member? Join today