The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Cyrus on November 21, 2007, 02:25:01 AM

Title: Listview Help
Post by: Cyrus on November 21, 2007, 02:25:01 AM
Hey all, for some reason I'm having trouble with listview. I've got it created and pretty. The columns are set and titled. That much is fine.

I have 3 columns and my listview is hList. I just cant seem to add any items to it...

What I'm needing is how to add a row with 3 columns.

Thanks :)
Title: Re: Listview Help
Post by: donkey on November 21, 2007, 03:24:26 AM
Hi Cyrus,

Without any code or a clear idea with what's happening I can't be of much help however I have a couple of samples demonstrating listviews on my website, they are written in GoAsm but that is easily translated to MASM syntax, you can take a look at...

www.assembler.ca

You will find them in the GoAsm projects section, also WinExplorer makes use of a few listviews including a virtual one. Source code is included for all samples and WinExplorer.

Donkey
Title: Re: Listview Help
Post by: Cyrus on November 21, 2007, 03:36:52 AM
Well Im using RadASM with masm. And the actual application is comparing the hex dumps of 2 files. Once a difference is detected i want to add the offset, old byte, and new byte. Got all the information and it works just cant add it to the listview.

Here' s what the listview looks like:

OFFSET      OLD BYTE        NEW BYTE

They are in buffer1,buffer2, and buffer3 that the time item needs added.
Title: Re: Listview Help
Post by: Cyrus on November 21, 2007, 07:13:06 AM
Ok I've managed to get it. Confusing that it uses 2 api's to do one thing.
Title: Re: Listview Help
Post by: ragdog on November 21, 2007, 05:28:20 PM
hi

mean your this?


AddItem PROC _Item1:DWORD,_Item2:DWORD,_Item3:DWORD
LOCAL Item :LV_ITEM
    mov Item.imask,LVIF_TEXT
    mov ebx,_Item1
    mov Item.pszText,ebx
    mov Item.iSubItem,0
    invoke SendMessage,hList,LVM_INSERTITEM,0,addr Item
    mov Item.iItem,eax
    inc Item.iSubItem
    mov ebx,_Item2
    mov Item.pszText,ebx
    invoke SendMessage,hList,LVM_SETITEM,0,addr Item
    inc Item.iSubItem
    mov ebx,_Item3
    mov Item.pszText,ebx
    invoke SendMessage,hList,LVM_SETITEM,0,addr Item
    inc Item.iSubItem
    inc Item.iItem
ret     
AddItem ENDP


greetz
ragdog
Title: Re: Listview Help
Post by: Cyrus on November 22, 2007, 12:27:02 AM
Yes ragdog exactly. I wasnt using the LVM_SETITEM. MSDN was confusing when I read up on it. But, a great example just the same. :)