- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page