February 11th, 2026
0 reactions

How do I suppress the hover effects when I put a Win32 common controls ListView in single-click mode?

A customer had a Win32 common controls ListView in single-click mode. This has a side effect of enabling hover effects: When the mouse hovers over an item, the cursor changes to a hand, and the item gets highlighted in the hot-track color. How can they suppress these hover effects while still having single-click activation?

When the user hovers over an item, the ListView sends a LVN_HOT­TRACK notification, and you can suppress all hot-tracking effects by returning 1.

    // WndProc
    case WM_NOTIFY:
    {
        auto nm = (NMLISTVIEW*)lParam;
        if (nm->hdr.code == LVN_HOTTRACK)
        {
            return 1;
        }
    }
    break;

If you are doing this from a dialog box, you need to set the DWLP_MSG­RESULT to the desired return value, which is 1 in this case, and then return TRUE to say “I handled the message; use the value I put into DWLP_MSG­RESULT.”

    // DlgProc
    case WM_NOTIFY:
    {
        auto nm = (NMLISTVIEW*)lParam;
        if (nm->hdr.code == LVN_HOTTRACK)
        {
            SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 1);
            return TRUE;
        }
    }
    break;
Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments