News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

SetClipboardViewer

Started by bomz, June 20, 2011, 05:33:38 AM

Previous topic - Next topic

bomz

this work. but if in Item have 10 mb data this operation need the same size of memory

bomz

for ICON you simply set LVM_SETITEMPOSITION , but for REPORT there is no any reasonable operation

May be HOOK use

qWord

as said, if you save the data as  a pointer, then their is no need to alloc an extra buffer.
In other word: save the clipboard data in an buffer (alloc()) and save the pointer in LVITEM.lParam. Create an second small buffer, and copy only the first bytes of the clipboard data (e.g. 260 bytes/characters). This Buffer then is passed in LVITEM.pszText.
FPU in a trice: SmplMath
It's that simple!

bomz

and what happens with LVITEM.lParam when List updated?

UpdatelParam proc uses edi
LOCAL lvi:LV_ITEM

invoke SendMessage,hList, LVM_GETITEMCOUNT,0,0
mov edi,eax
mov lvi.imask,LVIF_PARAM
mov lvi.iSubItem,0
mov lvi.iItem,0
@@:
mov eax, lvi.iItem
mov lvi.lParam, eax
invoke SendMessage,hList, LVM_SETITEM,0,addr lvi
add lvi.iItem, 1
sub edi, 1
jnz @B
ret

UpdatelParam endp

qWord

what do you mean with update? - I didn't understand the sense of shown code.
FPU in a trice: SmplMath
It's that simple!

bomz

after sorting list, ListView must Updated to show changes



Iczelion lesson 31 or C:\masm32\examples\exampl06\listview

qWord

sry, I don't now for what the lParam is used in Iczelion tutorial - it is userdefined value, that can be used for whatever purpose: my suggestion is to use it for storing buffers pointer.
FPU in a trice: SmplMath
It's that simple!

bomz

I think that if I store point to clipboard memory in it, after changing clipboard data this memory free

http://msdn.microsoft.com/en-us/library/bb774760%28v=vs.85%29.aspx
QuotelParam

    Type: LPARAM

    Value specific to the item. If you use the LVM_SORTITEMS message, the list-view control passes this value to the application-defined comparison function. You can also use the LVM_FINDITEM message to search a list-view control for an item with a specified lParam value.

qWord

Quote from: bomz on June 22, 2011, 11:27:02 PM
I think that if I store point to clipboard memory in it, after changing clipboard data this memory free
surly not! Except that your comparison function, or some other code, overwrite this value...
FPU in a trice: SmplMath
It's that simple!

bomz

hm. this method need one else table. ListView - is table.
The sort message may changes places of Items - how it do this....

qWord

if you need more than one value (LVITEM.lParam) per item, then use a structure and associate it as a pointer through LVITEM.lParam.

(BTW: a linked list comes surly more closer to how an listview is implemented)

qWord
FPU in a trice: SmplMath
It's that simple!