flat assembler
Message board for the users of flat assembler.

Index > Windows > Copy to Clipboard

Author
Thread Post new topic Reply to topic
Alessio



Joined: 26 Sep 2003
Posts: 35
Location: Viterbo, Italy
Alessio 03 Oct 2003, 21:01
Hi,
I'm trying to copy to clipboard
a string using source code taken
from fasmw.

Can someone put something more easy?

Debugging my application with OllyDBG,
I've seen that GlobalAlloc is referred as LocalAlloc,
can someone explain to me this ?

Thanks.
Post 03 Oct 2003, 21:01
View user's profile Send private message MSN Messenger Reply with quote
Alessio



Joined: 26 Sep 2003
Posts: 35
Location: Viterbo, Italy
Alessio 04 Oct 2003, 14:57
I've done it by myself.

invoke OpenClipboard,[hwnd]
invoke GlobalAlloc,GMEM_MOVEABLE+GMEM_DDESHARE,[slen] ;length of string + 1
mov [hmem],eax
invoke GlobalLock,[hmem]
invoke lstrcpy,eax,szBuffer
invoke EmptyClipboard
invoke GlobalUnlock,[hmem]
invoke SetClipboardData,CF_TEXT,[hmem]
invoke CloseClipboard

Seems to working!
Post 04 Oct 2003, 14:57
View user's profile Send private message MSN Messenger Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 04 Oct 2003, 15:01
Local** Functions end up calling Global** functions.
Post 04 Oct 2003, 15:01
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.