Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Listview control-check boxes

rjar
Beginner
508 Views
Hi,
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. 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,
Archana.
0 Kudos
1 Reply
gchien
Beginner
508 Views
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
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/macros/listview_setitemstate.asp
(all in one line) for more details.

HTH,
Greg Chien
http://protodesign-inc.com
0 Kudos
Reply