comctl32: Ensure coordinates are valid during listview marquee selection.

This commit is contained in:
Owen Rudge 2009-10-05 18:07:45 +01:00 committed by Alexandre Julliard
parent 6aac7cfafa
commit 2a869d039a
1 changed files with 13 additions and 0 deletions

View File

@ -3607,6 +3607,19 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
WORD wDragWidth = GetSystemMetrics(SM_CXDRAG);
WORD wDragHeight= GetSystemMetrics(SM_CYDRAG);
/* Ensure coordinates are within client bounds */
if (x < 0)
x = 0;
if (y < 0)
y = 0;
if (x > infoPtr->rcList.right)
x = infoPtr->rcList.right;
if (y > infoPtr->rcList.bottom)
y = infoPtr->rcList.bottom;
tmp.x = x;
tmp.y = y;