Hello, in many examples for coding in masm32 I have found a detailled description how
to build a small application that contains a simple listbox. If the user (double)click
on a list item, it is presented in a Message Box.
My question is: how can I copy this selected item into the clipboard instead of presenting
it in a message box???
....example:
.....
.if uMsg == WM_CLOSE
.elseif uMsg == WM_LBUTTONDBLCLK
invoke SendMessage,hWin,LB_GETCURSEL,0,0
mov IndexItem, eax
invoke SendMessage,hWin,LB_GETTEXT,IndexItem,ADDR Buffer ; item is now in Buffer
[copy to clipboard, maybe useful for inserting it later into a texteditor or an input field]
.....
Thanks for any help, best regards
Stefan
Assuming that the item is text, there is a commented example here:
http://www.masm32.com/board/index.php?topic=3879.msg28908#msg28908
And for MASM32 v10 the MASM32 library includes procedures for getting and setting clipboard text, see \masm32\m32lib\getcbtxt.asm and \masm32\m32lib\setcbtxt.asm
And another example here: http://www.masm32.com/board/index.php?topic=9583.0
simonst,
In the library included with GeneSys, there is:
GetClipboardTextA
GetClipboardTextW
SetClipboardTextA
SetClipboardTextW
hth,
Paul
WOW!!!! Thank You all, great examples! I have tried it out, it works fine!!!!!!
Best Regards,
Stefan :U