Re: Listview and time...

new topic     » topic index » view thread      » older message » newer message

Look at Dereks last post, this is a fix to display multiple LV_Column info.
And is marginally faster than my previous post.....

-- Get the handle for this control once.
hWnd = getHandle(lottoListLV)
-- Pre allocate some memory areas and addresses.
LV_ITEM = struct_LVITEM(lvitem_MASK, 0, 0, 0, 0, 0, 0, 0)
pItem = LV_ITEM + 4
pSubItem = LV_ITEM + 8
-- WARNING!: This only copes with data up to 499 bytes!
cString = acquire_mem(LV_ITEM, 500)
poke4( LV_ITEM + 20, cString )
pTextLen = LV_ITEM + 24

item = 0
for ix = length(data) to 1 by -1 do

     poke4( pItem, item)
     item += 1
     subitem = 0
     for xi = 1 to length(data[ix]) do
          subdata = data[ix][xi]
          poke4( pSubItem, subitem)
          poke(cString, subdata)
          poke(cString + length(subdata) , 0)
          poke4(pTextLen, length(subdata) )
          subitem += 1

          if subitem = 1 then
          VOID =  w32Func( xSendMessage, { hWnd, LVM_INSERTITEM, 0, LV_ITEM } )
          else
          VOID =  w32Func( xSendMessage, { hWnd, LVM_SETITEMTEXT, item-1,
LV_ITEM } )
          end if

     end for

end for
release_mem(LV_ITEM)

Euman

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu