Jump to content
Tuts 4 You

Listview Help


DrPepUr

Recommended Posts

I am messing around with a list view, I have 2 example sources, but I can not figure out what I am doing wrong.

I am having trouble adding items to the list, I can get the items in the first Col but not in col1 or col2

here is the basic code I am using, I got it out of one of the example projects .

LOCAL lvi: LV_ITEM
mov lvi.imask, LVIF_TEXT or LVIF_IMAGE or LVIF_PARAM
push 0
pop lvi.iItem
push 0
pop lvi.lParam
mov lvi.iSubItem,00
mov eax, offset Item1
mov lvi.pszText, eax
INVOKE SendMessage, hList, LVM_INSERTITEM, 0, addr lvi
inc lvi.iSubItem
mov eax,offset SubItem1
mov lvi.pszText, eax
invoke SendMessage,hList,LVM_SETITEM,0,addr lvi

Like I said above It adds the Item but not the SubItem

Any Ideas?

Thanks in advance,

Dustyh1981

Link to comment

Dunno if that helps but maybe remove the [LVIF_IMAGE or LVIF_PARAM] masks...

Doesnt make sense to me when you set them to 0 anyway.

Arent subitems just columns ? You have to call LVM_INSERTCOLUMN before I guess...

The code you posted looks fine at least from what MSDN says, never dealt with that stuff myself :)

Link to comment
GamingMasteR

As killboy said you must had added the columns b4 u can add a subitem.

Also try zero the whole structure b4 filling it's members.

Anyway i'm making a sample right now .

Edited by GamingMasteR
Link to comment

Thanks guys, I dunno about half this stuff , I have only used a listview in vb & vb.net aand had problems with those aswell. I will try your examlple. Thanks for the help.

Dustyh1981

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...