![]() |
|
#6
|
||||
|
||||
![]() ну какая разница:
Код:
procedure TCustomRichEdit.CreateParams(var Params: TCreateParams); const RichEditModuleName = 'RICHED32.DLL'; HideScrollBars: array[Boolean] of DWORD = (ES_DISABLENOSCROLL, 0); HideSelections: array[Boolean] of DWORD = (ES_NOHIDESEL, 0); begin if FRichEditModule = 0 then begin FRichEditModule := LoadLibrary(RichEditModuleName); if FRichEditModule <= HINSTANCE_ERROR then FRichEditModule := 0; end; inherited CreateParams(Params); CreateSubClass(Params, 'RICHEDIT'); ![]() ![]() Код:
procedure Add(ARichEdit: THandle; const s: String); var CharFormat: TCharFormat; begin ZeroMemory(@CharFormat, SizeOf(TCharFormat)); CharFormat.cbSize:=SizeOf(TCharFormat); CharFormat.dwMask:=CFM_COLOR or CFM_BOLD or Longint(CFM_SIZE); CharFormat.crTextColor:=((RandomRange(0, $f) shl $4) shl 16) or ((RandomRange(0, $f) shl $4) shl 8) or ((RandomRange(0, $f) shl $4) shl 0); CharFormat.yHeight:=20*RandomRange($8, $f); if Random>0.5 then CharFormat.dwEffects:=CharFormat.dwEffects or CFE_BOLD; SendMessage(ARichEdit, EM_SETCHARFORMAT, SCF_SELECTION, Longint(@CharFormat)); SendMessage(ARichEdit, EM_REPLACESEL, 0, Longint(PChar(s))); end; Пишу программы за еду. __________________ |