The infoPtr->marqueeRect structure is not currently initialized before the marquee highlight sequence starts, resulting in the RECT having initial coordinates of (0,0)-(0,0). These coordinates cause the first item in the listview control to be identified as being within the range of the marqueeRect's coordinates.
That item is then set to LVIS_SELECTED even though it is not part of the marquee selection.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- dlls/comctl32/listview.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 799ec509f33..7d2b7874b84 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -4113,6 +4113,7 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
/* Begin selection and capture mouse */ infoPtr->bMarqueeSelect = TRUE; + infoPtr->marqueeRect = rect; SetCapture(infoPtr->hwndSelf); } }
On 4/26/21 1:59 PM, Hugh McMaster wrote:
The infoPtr->marqueeRect structure is not currently initialized before the marquee highlight sequence starts, resulting in the RECT having initial coordinates of (0,0)-(0,0). These coordinates cause the first item in the listview control to be identified as being within the range of the marqueeRect's coordinates.
That item is then set to LVIS_SELECTED even though it is not part of the marquee selection.
Could you describe how to test this, with builtin programs if possible?
Hi Nikolay,
On Tue, 27 Apr 2021 at 03:47, Nikolay Sivov wrote:
On 4/26/21 1:59 PM, Hugh McMaster wrote:
The infoPtr->marqueeRect structure is not currently initialized before the marquee highlight sequence starts, resulting in the RECT having initial coordinates of (0,0)-(0,0). These coordinates cause the first item in the listview control to be identified as being within the range of the marqueeRect's coordinates.
That item is then set to LVIS_SELECTED even though it is not part of the marquee selection.
Could you describe how to test this, with builtin programs if possible?
1. In regedit or explorer, click on the window with the listview control. Then hold down the left mouse button in an empty part of the listview control and move the cursor diagonally to create a marquee rectangle. You will see the first list item become selected. 2. If the list has multiple items, try selecting multiple items using Ctrl-click. Then repeat step 1 while holding Ctrl down. The first list item still becomes selected.
I've seen this behaviour in programs using report/details and list modes. I don't believe it affects icon mode.
You can also see this issue using Control Spy.
Let me know if you need more information.