richedit: Show arrow cursor over scrollbar.

This commit is contained in:
Dylan Smith 2008-10-06 04:28:37 -04:00 committed by Alexandre Julliard
parent 936191887e
commit 1d21d24a51
1 changed files with 19 additions and 0 deletions

View File

@ -2103,10 +2103,29 @@ static BOOL ME_SetCursor(ME_TextEditor *editor)
POINT pt;
BOOL isExact;
int offset;
SCROLLBARINFO sbi;
DWORD messagePos = GetMessagePos();
pt.x = (short)LOWORD(messagePos);
pt.y = (short)HIWORD(messagePos);
sbi.cbSize = sizeof(sbi);
GetScrollBarInfo(editor->hWnd, OBJID_HSCROLL, &sbi);
if (!(sbi.rgstate[0] & (STATE_SYSTEM_INVISIBLE|STATE_SYSTEM_OFFSCREEN)) &&
PtInRect(&sbi.rcScrollBar, pt))
{
SetCursor(LoadCursorW(NULL, (WCHAR*)IDC_ARROW));
return TRUE;
}
sbi.cbSize = sizeof(sbi);
GetScrollBarInfo(editor->hWnd, OBJID_VSCROLL, &sbi);
if (!(sbi.rgstate[0] & (STATE_SYSTEM_INVISIBLE|STATE_SYSTEM_OFFSCREEN)) &&
PtInRect(&sbi.rcScrollBar, pt))
{
SetCursor(LoadCursorW(NULL, (WCHAR*)IDC_ARROW));
return TRUE;
}
ScreenToClient(editor->hWnd, &pt);
if ((GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_SELECTIONBAR) &&
(pt.x < editor->selofs ||
(editor->nSelectionType == stLine && GetCapture() == editor->hWnd)))