.386
.model flat, stdcall
option casemap :none

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

.data
szTest db "Das ist ein Test!", 0


.data?
nLen dd ?
hMem dd ?
pMem dd ?

.code

start:
invoke lstrlen, addr szTest
inc eax
mov nLen, eax

invoke OpenClipboard, 0

invoke GlobalAlloc, GHND, nLen
mov hMem, eax

invoke GlobalLock, eax
mov pMem, eax

lea esi, szTest
mov edi, eax
mov ecx, nLen
rep movsb

call EmptyClipboard

invoke GlobalUnlock, hMem

invoke SetClipboardData, CF_TEXT, hMem

call CloseClipboard

invoke MessageBox, 0, addr szTest, 0, 0

invoke ExitProcess, 0

end start

Posted on 2001-10-23 11:58:09 by bazik
dont you miss a <cld> instruction before rep movsb ?
Posted on 2001-10-26 07:43:40 by beaster
That is the default under windows.
Posted on 2001-10-26 12:25:53 by bitRAKE