News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Problems with RAEdit

Started by msmith, January 26, 2005, 04:59:07 PM

Previous topic - Next topic

msmith

I have been using RAEdit for using RAEdit for quite some time but have one small problem and a question.

EM_CANPASTE always returns FALSE. EM_CANUNDO and EM_CANREDO work fine.

I cannot see a function or message to write text to a PORTION of the control while leaving the current text intact. (Something like "insert text")

Thanks to Ketil for this great control!

KetilO

Hi

1.
This should work:

invoke SendMessage,hEdit,EM_CANPASTE,CF_TEXT,0

2.
Use EM_REPLACESEL to insert or replace text (depends if there is a selection or not).

KetilO

msmith

Thanks for the prompt reply.

For point 1) Here is my code


; LN:1560 IF Edit.CANREDO=TRUE THEN
mov edi,!Edit
invoke SendMessage, dword [edi+HandleOffs],EM_CANREDO,0,0
mov [_Tmp1],eax
cmp [_Tmp1],1
jne _Lbl86
; LN:1561 ENABLEMENUITEM MainMenu,mnuReDo
mov eax,1007
invoke EnableMenuItem,[MainMenu],eax,MF_ENABLED+MF_BYCOMMAND
; LN:1562 ELSE
jmp _Lbl87
_Lbl86:
; LN:1563 DISABLEMENUITEM MainMenu,mnuReDo
mov eax,1007
invoke EnableMenuItem,[MainMenu],eax,MF_GRAYED+MF_BYCOMMAND
; LN:1564 ENDIF
_Lbl87:
; LN:1565 IF Edit.CANPASTE=TRUE THEN
mov edi,!Edit
invoke SendMessage, dword [edi+HandleOffs],EM_CANPASTE,CF_TEXT,0
mov [_Tmp1],eax
cmp [_Tmp1],1
jne _Lbl88
; LN:1566 ENABLEMENUITEM MainMenu,mnuPaste
mov eax,1010
invoke EnableMenuItem,[MainMenu],eax,MF_ENABLED+MF_BYCOMMAND
; LN:1567 ELSE
jmp _Lbl89
_Lbl88:
; LN:1568 DISABLEMENUITEM MainMenu,mnuPaste
mov eax,1010
invoke EnableMenuItem,[MainMenu],eax,MF_GRAYED+MF_BYCOMMAND
; LN:1569 ENDIF
_Lbl89:


CANREDO works fine (as dow CANREDO), but CANPASTE always returns FALSE. As you can see, the usage is basicaaly true to your example in the previous post.

2) As for point 2, leave it to Microsoft to give a function a misleading name. Thanks for the tip!

KetilO

Hi

Are there any text on the clipboard? If there is, verify values of EM_CANPASTE (WM_USER + 50) and CF_TEXT (1)

KetilO

msmith

Hi Ketil,

I have tried it with and without something in the clipboard.

The values for EM_CANPASTE and CF_TEXT are correct as you describe.

Thank you for your help.

Mike