Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

Richedit with raw RTF script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Richedit with raw RTF script

    Code:
    #INCLUDE "WIN32API.INC"
    #INCLUDE "RICHEDIT.INC"
    
    FUNCTION PBMAIN()
      LOCAL hDlg AS DWORD
      LoadLibrary("RICHED32.DLL")
    
      DIALOG NEW 0, "RichEdit Test", , , 225, 110, %WS_SYSMENU TO hDlg
      CONTROL ADD "RichEdit", hDlg, 1001, "RichEdit1", 5, 5, 205, 85, %WS_CHILD OR %WS_VISIBLE OR %WS_DISABLED OR %ES_MULTILINE
    
      LOCAL CopiedText AS STRING
    
      CopiedText = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}}"+$CRLF+ _
    "\viewkind4\uc1\pard\sb100\sa100\lang3081\f0\fs24 ""Hello world. \b This is bold\b0 , and \i this is italic\i0 .\line This is a copyright sign: \'a9""\lang1033\f1\fs20\par"+$CRLF+ _
    "}"
    
      CONTROL SET TEXT hDlg, 1001, CopiedText
      DIALOG SHOW MODAL hDlg
    
    END FUNCTION
    To create the raw RTF script you can simply use Windows write.exe, save as RTF then view the file in notepad
    -
Working...
X