flat assembler
Message board for the users of flat assembler.

Index > Windows > Win clipboard problems.

Thread Post new topic Reply to topic

Joined: 21 Apr 2012
Posts: 1719
Roman 19 Jul 2022, 18:02
Some time clipboard send empty text to fasm editor window.
And selected text disapiared in fasm editor window.
I found in fasm editor this code
        cmp     [was_selection],0
        je      ignore
        call    copy_to_clipboard
        jmp     ignore
        call    get_block_length
        inc     ecx
        invoke  GlobalAlloc,GMEM_MOVEABLE+GMEM_DDESHARE,ecx
        mov     ebx,eax
        invoke  GlobalLock,ebx
        mov     edi,eax
        push    ebx
        call    copy_block
        pop     ebx
        invoke  GlobalUnlock,ebx
        invoke  OpenClipboard,[hwnd]
        invoke  EmptyClipboard
        invoke  SetClipboardData,CF_TEXT,ebx
        or      eax,eax
        jz      copy_failed
        invoke  CloseClipboard
        invoke  GlobalFree,ebx   ;why free only when  copy_failed ?

And why fasm editor using GMEM_MOVEABLE+GMEM_DDESHARE ?
And not using only GMEM_MOVEABLE ?
msdn and many tutorials using GMEM_MOVEABLE
Post 19 Jul 2022, 18:02
View user's profile Send private message 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.