News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

how to get the item text from list view ?

Started by newBie, February 13, 2013, 08:44:49 PM

Previous topic - Next topic

newBie

Hi,

I'm trying to get the item text from my list view. In C i can do that using ListView_GetItemText.
I tried it in masm32 but it gives me error: undefined symbol ListView_GetItemText

I tried to include Commctrl.inc on my header but I can't find it in my include folder

can any one help ?

thanks in advance

jj2007


ragdog

QuoteIn C i can do that using ListView_GetItemText.

In C is ListView_GetItemText a macro

MSDN SAY:
QuoteListView_GetItemText macro (Windows)

You can use this macro or send the LVM_GETITEMTEXT message explicitly.

It give good people that have make this for asm


ListView_InsertColumn macro hWnd,y,z
invoke SendMessage,hWnd,LVM_INSERTCOLUMN,y,z
endm
ListView_DeleteColumn macro hWnd,y
invoke SendMessage,hWnd,LVM_DELETECOLUMN,y,0
endm
ListView_InsertItem macro hWnd,pItem
invoke SendMessage,hWnd,LVM_INSERTITEM,0,pItem
endm
ListView_DeleteItem macro hWnd,iItem
invoke SendMessage,hWnd,LVM_DELETEITEM,iItem,0
endm
ListView_DeleteAllItems macro hWnd
invoke SendMessage,hWnd,LVM_DELETEALLITEMS,0,0
endm
ListView_GetItem macro hWnd,pItem
invoke SendMessage,hWnd,LVM_GETITEM,0,pItem
endm
ListView_SetItem macro hWnd,pItem
invoke SendMessage,hWnd,LVM_SETITEM,0,pItem
endm
ListView_GetItemText macro hWnd,iItem,iSubItem_,pszText_,cchTextMax_
sub esp,sizeof LV_ITEM
mov [esp].LV_ITEM.iSubItem,iSubItem_
mov [esp].LV_ITEM.pszText,pszText_
mov [esp].LV_ITEM.cchTextMax,cchTextMax_
invoke SendMessage,hWnd,LVM_GETITEMTEXT,iItem,esp
add esp,sizeof LV_ITEM
endm

ListView_GetNextItem macro hWnd,y,z
invoke SendMessage,hWnd,LVM_GETNEXTITEM,y,z
endm
ListView_SetItemState macro hWnd,iItem,iState,iStateMask
sub esp,sizeof LV_ITEM
mov [esp].LV_ITEM.state,iState
mov [esp].LV_ITEM.stateMask,iStateMask
invoke SendMessage,hWnd,LVM_SETITEMSTATE,iItem,esp
add esp,sizeof LV_ITEM
endm
ListView_GetSelectedCount macro hWnd
invoke SendMessage,hWnd,LVM_GETSELECTEDCOUNT,0,0
endm
ListView_GetItemCount macro hWnd
invoke SendMessage,hWnd,LVM_GETITEMCOUNT,0,0
endm
ListView_SetItemCount macro hWnd,items
invoke SendMessage,hWnd,LVM_SETITEMCOUNT,items,0
endm
ListView_SortItems macro hWnd,y,z
invoke SendMessage,hWnd,LVM_SORTITEMS,z,y
endm
ListView_CreateDragImage macro hWnd,iItem,lpPoint
invoke SendMessage,hWnd,LVM_CREATEDRAGIMAGE,iItem,lpPoint
endm
ListView_HitTest macro hWnd,lpHitTest
invoke SendMessage,hWnd,LVM_HITTEST,0,lpHitTest
endm
ListView_SetExtendedListViewStyle macro hWnd,y
invoke SendMessage,hWnd,LVM_SETEXTENDEDLISTVIEWSTYLE,0,y
endm
ListView_EnsureVisible macro hWnd,iItem,fPartial
invoke SendMessage,hWnd,LVM_ENSUREVISIBLE,iItem,fPartial
endm

newBie

Thanks for the help guys.

Thanks ragdog for sharing these awesome macros.
got it working now