The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: georgek01 on February 07, 2006, 08:29:47 AM

Title: ListView group header text.
Post by: georgek01 on February 07, 2006, 08:29:47 AM
Hello all!

I hope someone can assist with the following problem I'm experiencing.

I have a ListView control with a few list items under a group header. Ultimately I would like to walk through the list view groups and compare the header text to column text so I can re-assign items to different groups, depending on the column clicked by the user. I am however unable to "get" the group header text.

The test app I attached creates 1 group and adds 2 items to it. When the Group Header button is clicked, the group header text should be displayed in a message box.

Your assistance will be greatly appreciated!!

[attachment deleted by admin]
Title: Re: ListView group header text.
Post by: Tedd on February 07, 2006, 11:49:50 AM
LVM_GETCOLUMN ?
(with lvcol.imask = LVCF_TEXT)
Title: Re: ListView group header text.
Post by: georgek01 on February 07, 2006, 12:10:12 PM
I'm looking for the group header text filled by the LVGROUP structure from LVM_GETGROUPINFO message as per code extract below.


local lvg:LVGROUP

; --- set structure options
mov lvg.cbSize, sizeof lvg
mov lvg.imask, LVGF_HEADER or LVGF_NONE
mov lvg.pszHeader, offset dbuffer
mov lvg.cchHeader, lengthof dbuffer

; --- fill lvg structure with group ID = 0
invoke SendMessage,hList,LVM_GETGROUPINFO,0d,addr lvg

.if eax != -1
invoke WideCharToMultiByte,0,0,addr dbuffer,-1,addr cbuffer,128,NULL,NULL
.if eax != 0
invoke MessageBox,h,addr cbuffer,addr szAppName,MB_OK
.else
invoke ShowErrorMessage,h
.endif
.endif