Посмотри в MSDN Q147887 (скроллинг в TextBox, в RTB аналогично). А вот описание EM_SCROLL и EM_LINESCROLL.
EM_LINESCROLL
Edit controls: The EM_LINESCROLL message scrolls the text vertically or horizontally in a multiline edit control.
Rich edit controls: The EM_LINESCROLL message scrolls the text vertically in a multiline edit control.
- Код: Выделить всё
EM_LINESCROLL
wParam = (WPARAM) cxScroll; // characters to scroll horizontally
lParam = (LPARAM) cyScroll; // lines to scroll vertically
ParameterscxScroll Edit controls: Value of wParam. Specifies the number of characters to scroll horizontally.
Rich edit controls: This parameter is not used; it must be zero.
cyScroll Value of lParam. Specifies the number of lines to scroll vertically.
Return Values
If the message is sent to a multiline edit control, the return value is TRUE.
If the message is sent to a single-line edit control, the return value is FALSE.
RemarksThe edit control does not scroll vertically past the last line of text in the edit control. If the current line plus the number of lines specified by the cyScroll parameter exceeds the total number of lines in the edit control, the value is adjusted so that the last line of the edit control is scrolled to the top of the edit-control window.
Edit controls: The EM_LINESCROLL message can be used to scroll horizontally past the last character of any line.
QuickInfo for rich edit controls: The EM_LINESCROLL message is supported in Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
EM_SCROLLThe EM_SCROLL message scrolls the text vertically in a multiline edit control. This message is equivalent to sending a WM_VSCROLL message to the edit control. You can send this message to either an edit control or a rich edit control.
- Код: Выделить всё
EM_SCROLL
wParam = (WPARAM) (INT) nScroll; // scroll action
lParam = 0; // not used; must be zero
Parameters
nScroll
Value of wParam. Specifies the action the scroll bar is to take. This parameter may be one of the following values. Value Meaning
SB_LINEDOWN Scrolls down one line.
SB_LINEUP Scrolls up one line.
SB_PAGEDOWN Scrolls down one page.
SB_PAGEUP Scrolls up one page.
Return Values
If the message is successful, the high-order word of the return value is TRUE, and the low-order word is the number of lines that the command scrolls. The number returned may not be the same as the actual number of lines scrolled if the scrolling moves to the beginning or the end of the text. If the nScroll parameter specifies an invalid value, the return value is FALSE.
Remarks
To scroll to a specific line or character position, use the EM_LINESCROLL message.
To scroll the caret into view, use the EM_SCROLLCARET message.
Remarks
QuickInfo for rich edit controls: The EM_SCROLL message is supported in Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
З.Ы. Разумеется SendMessage
Lasciate ogni speranza, voi ch'entrate.