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

Whats happen if 'next window' leave chain before application ends?
.if uMsg==WM_CREATE
invoke SetClipboardViewer,hWnd
mov NextHandle, eax


.ELSEIF uMsg == WM_DRAWCLIPBOARD
.if NextHandle!=0
invoke SendMessage,NextHandle,WM_DRAWCLIPBOARD,0,0
.endif


.ELSEIF uMsg == WM_CHANGECBCHAIN
.if NextHandle!=0
invoke SendMessage,NextHandle,WM_CHANGECBCHAIN,wParam,lParam
.endif

.elseif uMsg==WM_DESTROY
.if NextHandle!=0
        invoke ChangeClipboardChain, hWnd, NextHandle
.endif
invoke PostQuitMessage,NULL

bomz

sorry

.ELSEIF uMsg == WM_CHANGECBCHAIN
mov eax, wParam
.if NextHandle==eax
mov eax, lParam
mov NextHandle, eax
.endif
.if NextHandle!=0
invoke SendMessage,NextHandle,WM_CHANGECBCHAIN,wParam,lParam
.endif
xor eax, eax


.elseif uMsg==WM_DESTROY
        invoke ChangeClipboardChain, hWnd, NextHandle
invoke PostQuitMessage,NULL

bomz

How in listview move string UP or DOWN?

SendMessage LVM_SETITEMPOSITION - works only with ICON.

bomz


HELP! How move up and move down item in listview?

hole day try do it. find only delphi examples

qWord

LVM_DELETEITEM + LVM_INSERTITEM ?
FPU in a trice: SmplMath
It's that simple!

bomz

Thanks. It's work. may be it is not optimal



DOWNProc proc ITEM:DWORD
LOCAL lvi:LV_ITEM
LOCAL lvi1:LV_ITEM
LOCAL buffer[24]:BYTE
LOCAL buffer1[256]:BYTE

mov lvi.imask, LVIF_TEXT
lea eax, buffer
mov lvi.pszText, eax
mov lvi.cchTextMax, 24
mov lvi.iSubItem,0
invoke SendMessage,hList,LVM_GETITEMTEXT,ITEM,addr lvi

mov eax, ITEM
mov lvi1.iItem,eax
mov lvi1.iSubItem,1
mov lvi1.imask,LVIF_TEXT
lea eax,buffer1
mov lvi1.pszText,eax
mov lvi1.cchTextMax,256
invoke SendMessage,hList,LVM_GETITEM,ITEM,addr lvi1

add lvi.iItem,2
add lvi1.iItem,2

invoke SendMessage,hList,LVM_INSERTITEM, 0,  addr lvi

invoke SendMessage,hList,LVM_SETITEM, 0, addr lvi1

invoke SendMessage,hList,LVM_DELETEITEM, ITEM, 0


ret

DOWNProc endp

bomz

QuoteIf the structure receives item attributes, pszText is a pointer to a buffer that receives the item text. Note that although the list-view control allows any length string to be stored as item text, only the first 260 TCHARs are displayed.

I try move it change index - but any result

bomz

When listview make LVM_SORTITEMS it move all Items.

bomz

This method Insert+Delete have back side: for training with ListView I making program which summarize clipboard. The size of clipboard buffer may be very different size from some bytes to many mb. If I each time recopy Item data - I must know the size of saving data

bomz



.elseif ax==IDM_MOVEDOWN
invoke SendMessage,hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSED
mov MoveString, eax
add eax, 1
mov MoveString1, eax
invoke SendMessage,hList,LVM_SORTITEMS,0,addr MoveProc
invoke UpdatelParam


MoveProc proc uses edi lParam1:DWORD, lParam2:DWORD, SortType:DWORD

mov eax, 0
mov esi, MoveString
mov edi, MoveString1
.if lParam1==esi && lParam2==edi
mov eax, 1
.endif

ret

MoveProc endp

qWord

 :dazzled: :eek :boohoo: :clap: :dance: ...
FPU in a trice: SmplMath
It's that simple!

bomz

I find some delphi code but don't understand nothing in it. than I find little russian language forum post where somebody say's that in report style the one way delete+insert.

dedndave

show us a link to the delphi code
maybe we can make sense of it   :P


dedndave

can't read Russian   :P

the first post with code ?
or the second ?