Scrolling RichEdit without it having focus
This is what I do:
SendMessage(RichEdit.Handle, WM_VSCROLL, SB_BOTTOM, 0);
See this blog post by François Gaillard: richedit-on-scrolling-strike.
Appearently a bug, here is the workaround solution :
procedure ScrollToEnd(ARichEdit: TRichEdit);
var
isSelectionHidden: Boolean;
begin
with ARichEdit do
begin
SelStart := Perform( EM_LINEINDEX, Lines.Count, 0);//Set caret at end
isSelectionHidden := HideSelection;
try
HideSelection := False;
Perform( EM_SCROLLCARET, 0, 0); // Scroll to caret
finally
HideSelection := isSelectionHidden;
end;
end;
end;