I would append a trailing null for setclipdata&CF_TEXT and trim that null from data returned by getclipdata CF_TEXT. The reason is that it should use the exact number of bytes for binary data such as CF_DIB
On Sun, 07 Jun 2009, Henry Rich wrote: > Thanks a million. When I ran your verb the last character was not put > on the clipboard - I'm guessing it's a NUL-termination problem which I > fixed with > > setclipdata=: 4 : 0 > NB. following line changed > h=. dllrv 'kernel32 GlobalAlloc x i x'&cd (2+16b2000) ; ms=. >:#x > mp=. dllrv 'kernel32 GlobalLock x x'&cd <h > NB. following line changed > (, x) memw mp, 0, ms , 2 > 'kernel32 GlobalUnlock i x'&cd <h > 'user32 OpenClipboard i x'&cd <0 > 'user32 EmptyClipboard i'&cd '' > 'user32 SetClipboardData x i x'&cd y ; h > 'user32 CloseClipboard i'&cd '' > ) -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
