Ok, im seriously loosing it trying to get checkboxes to be checked by default in new list view control.

Can someone please try to test and paste for me pls. :)
Posted on 2002-04-06 09:35:59 by notee1
hi notee1,

Thomas has posted a snipet of how to do this at his website. here is a direct link to it: http://www.madwizard.org/snippets/viewSnippet.php?s_ID=42
or i cut and pasted it here.
After you created the listview, set the extended style. I use the following code, 

as directly specifying dwExStyle did not work for me:

---
; Set checkboxes extended style
invoke SendMessage, hListView,LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_CHECKBOXES
---

When inserting items, you can set the initial state of the checkbox by settting the
state image index in the state member of the LV_ITEM structure.

---
; assumes tempItem is a LV_ITEM structure:
mov tempItem.stateMask, LVIS_STATEIMAGEMASK ; you may want to set more bits here
mov tempItem.state,(INDEX SHL 12)
---
INDEX can be 0,1 or 2:
0 = no checkbox
1 = unchecked checkbox
2 = checked
Posted on 2002-04-06 09:50:54 by smurf
Shweet, thats all i needed.
Somebody took my MSDN dvd, and now i have to do everything from my head :(
Posted on 2002-04-06 10:54:17 by notee1