comctl32: listview: Prevent DragDetect from removing WM_LBUTTONUP messages.

This commit is contained in:
Lei Zhang 2008-09-10 16:43:43 -07:00 committed by Alexandre Julliard
parent d7794170e7
commit 5f9b0db217
1 changed files with 22 additions and 10 deletions

View File

@ -3321,21 +3321,33 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
if (!(fwKeys & MK_LBUTTON)) if (!(fwKeys & MK_LBUTTON))
infoPtr->bLButtonDown = FALSE; infoPtr->bLButtonDown = FALSE;
if (infoPtr->bLButtonDown && DragDetect(infoPtr->hwndSelf, infoPtr->ptClickPos)) if (infoPtr->bLButtonDown)
{ {
LVHITTESTINFO lvHitTestInfo; MSG msg;
NMLISTVIEW nmlv; BOOL skip = FALSE;
/* Check to see if we got a WM_LBUTTONUP, and skip the DragDetect.
* Otherwise, DragDetect will eat it.
*/
if (PeekMessageW(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE))
if (msg.message == WM_LBUTTONUP)
skip = TRUE;
lvHitTestInfo.pt = infoPtr->ptClickPos; if (!skip && DragDetect(infoPtr->hwndSelf, infoPtr->ptClickPos))
LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE); {
LVHITTESTINFO lvHitTestInfo;
NMLISTVIEW nmlv;
ZeroMemory(&nmlv, sizeof(nmlv)); lvHitTestInfo.pt = infoPtr->ptClickPos;
nmlv.iItem = lvHitTestInfo.iItem; LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE);
nmlv.ptAction = infoPtr->ptClickPos;
notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv); ZeroMemory(&nmlv, sizeof(nmlv));
nmlv.iItem = lvHitTestInfo.iItem;
nmlv.ptAction = infoPtr->ptClickPos;
return 0; notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv);
return 0;
}
} }
else else
infoPtr->bLButtonDown = FALSE; infoPtr->bLButtonDown = FALSE;