Is there any way to write a add-in that can change text color in the editor of Winasm. I ask so because I can't do that via this one.


SetColor PROC pCharRange:DWORD
LOCAL charformat:CHARFORMAT
;// select the text before set color
invoke SendMessage, hEditor, EM_EXSETSEL, 0, pCharRange
mov charformat.cbSize, sizeof charformat
mov charformat.dwMask, CFM_COLOR + CFM_BOLD
M2M charformat.crTextColor, RED_COLOR
mov charformat.dwEffects, CFE_AUTOCOLOR + CFE_BOLD
invoke SendMessage, hEditor, EM_SETCHARFORMAT, SCF_SELECTION, addr charformat

Ret
SetColor EndP
Posted on 2004-02-12 17:13:09 by santa
Hi,

The CodeHi control supports many standard edit messages but not all.

As can be seen in the WAAddIn.inc file, the standard messages supported are: EM_EXLINEFROMCHAR, EM_EXSETSEL, EM_EXGETSEL, EM_FINDTEXTEX, EM_GETTEXTRANGE, EM_FINDWORDBREAK, EM_CANREDO, EM_REDO, EM_HIDESELECTION, EM_GETSELTEXT, EM_CANPASTE, EM_STREAMIN, EM_STREAMOUT, EM_CHARFROMPOS, EM_POSFROMCHAR, EM_LINEFROMCHAR, EM_LINEINDEX, EM_LINELENGTH, EM_GETLINE, EM_GETFIRSTVISIBLELINE, EM_LINESCROLL, EM_SCROLLCARET, EM_SETSEL, EM_GETSEL, EM_GETMODIFY, EM_SETMODIFY, EM_REPLACESEL, EM_GETLINECOUNT, EM_GETRECT, EM_CANUNDO, EM_UNDO, EM_EMPTYUNDOBUFFER, WM_COPY, WM_CUT, WM_PASTE, WM_CLEAR, WM_SETTEXT, WM_GETTEXT, WM_GETTEXTLENGTH.

In addition, the user messages supported are CHM_xxxxxx.

I would suggest you have a look on these messages and let me know of any questions you might have.

Regards,

akyprian
Posted on 2004-02-13 06:10:53 by akyprian