Checkboxes in Listview control

Checkboxes in Listview control

Hi,
I want some information on how to check and uncheck in a listview control. I don't have an image list in my listview control just the extended style for displaying check boxes.But I am unable to process check box messages.
I am not sure what the specific values of elements of the lv_item struct should be(the lvitem%state,lvitem%statemask,etc).

I am able to check the checkboxes if I do the following:
lvi%state=8192
lvI%stateMask = LVIS_STATEIMAGEMASK
ret = SendMessage (hwndlist, LVM_SETITEMSTATE,
sz_list,LOC(lvi))

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. 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?
Thanks,
Archana.

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