From e5b0ead2b5794fd1897e01bc62e1dfd7e392d8d1 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 13 Nov 2024 20:37:59 +0100 Subject: [PATCH] comctl32/listview: Initialize hot cursor handle. Signed-off-by: Nikolay Sivov --- dlls/comctl32/listview.c | 1 + dlls/comctl32/tests/listview.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 13d1bd092f2..5b7bdfac628 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -9585,6 +9585,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, WPARAM wParam, const CREATESTRUCTW * infoPtr->iVersion = COMCTL32_VERSION; infoPtr->colRectsDirty = FALSE; infoPtr->selected_column = -1; + infoPtr->hHotCursor = LoadCursorW(NULL, (LPWSTR)IDC_HAND); /* get default font (icon title) */ SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 12825ffaa7b..1a9831bbaec 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -7255,6 +7255,19 @@ static void test_LVM_GETNEXTITEM(void) DestroyWindow(hwnd); } +static void test_LVM_GETHOTCURSOR(void) +{ + HCURSOR cursor; + HWND hwnd; + + hwnd = create_listview_control(LVS_REPORT); + + cursor = (HCURSOR)SendMessageA(hwnd, LVM_GETHOTCURSOR, 0, 0); + ok(!!cursor, "Unexpected cursor %p.\n", cursor); + + DestroyWindow(hwnd); +} + START_TEST(listview) { ULONG_PTR ctx_cookie; @@ -7322,6 +7335,7 @@ START_TEST(listview) test_LVM_SETBKIMAGE(FALSE); test_custom_sort(); test_LVM_GETNEXTITEM(); + test_LVM_GETHOTCURSOR(); if (!load_v6_module(&ctx_cookie, &hCtx)) { @@ -7372,6 +7386,7 @@ START_TEST(listview) test_LVM_GETNEXTITEMINDEX(); test_LVM_GETNEXTITEM(); test_LVM_SETBKIMAGE(TRUE); + test_LVM_GETHOTCURSOR(); unload_v6_module(ctx_cookie, hCtx);