flat assembler
Message board for the users of flat assembler.

Index > Windows > Win clipboard problems.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1852
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
Code:
 wm_copy:
        cmp     [was_selection],0
        je      ignore
        call    copy_to_clipboard
        jmp     ignore
    copy_to_clipboard:
        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
        retn
    copy_failed:
        invoke  GlobalFree,ebx   ;why free only when  copy_failed ?
        retn
    
    

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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.