Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inserting RTF code to show up as RTF formatted text in RichEdit Field
#5
Thanks Gintaras,
I tried as below but still crashes WordPad. Any thoughts? Thanks! S

Function RichEditRtfString
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages


;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 RichEdit20A 0x54233044 0x200 8 8 208 104 ""
;4 Button 0x54032000 0x0 8 116 48 14 "Test"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str re3
if(!ShowDialog("RichEditRtfString" &RichEditRtfString &controls)) ret

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 4    goto gTest
ret 1

;gTest
str rtf = "{\rtf1 \ansi \deff0 {\fonttbl {\f0 Monotype Corsiva;}} \qc \f0 \fs120 \i \b Hello,\line World!}"
int w=win("Document - WordPad" "WordPadClass")
int c=  id(59648 w) ;;editable text 'Rich Text Window'

__ProcessMemory m.Alloc(c 1000)

m.WriteStr(rtf sizeof(rtf))
SETTEXTEX t
SendMessageW(c EM_SETTEXTEX &t m.address)


Messages In This Thread
RE: Inserting RTF code to show up as RTF formatted text in RichEdit Field - by stupomer - 03-30-2018, 02:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)