{"id":112057,"date":"2026-02-11T07:00:00","date_gmt":"2026-02-11T15:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=112057"},"modified":"2026-02-11T09:48:59","modified_gmt":"2026-02-11T17:48:59","slug":"20260211-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20260211-00\/?p=112057","title":{"rendered":"How do I suppress the hover effects when I put a Win32 common controls ListView in single-click mode?"},"content":{"rendered":"<p>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?<\/p>\n<p>When the user hovers over an item, the ListView sends a <code>LVN_<wbr \/>HOT\u00adTRACK<\/code> notification, and you can suppress all hot-tracking effects by returning 1.<\/p>\n<pre>    \/\/ WndProc\r\n    case WM_NOTIFY:\r\n    {\r\n        auto nm = (NMLISTVIEW*)lParam;\r\n        if (nm-&gt;hdr.code == LVN_HOTTRACK)\r\n        {\r\n            return 1;\r\n        }\r\n    }\r\n    break;\r\n<\/pre>\n<p>If you are doing this from a dialog box, you need to set the <code>DWLP_<wbr \/>MSG\u00adRESULT<\/code> to the desired return value, which is 1 in this case, and then return <code>TRUE<\/code> to say &#8220;I handled the message; use the value I put into <code>DWLP_<wbr \/>MSG\u00adRESULT<\/code>.&#8221;<\/p>\n<pre>    \/\/ DlgProc\r\n    case WM_NOTIFY:\r\n    {\r\n        auto nm = (NMLISTVIEW*)lParam;\r\n        if (nm-&gt;hdr.code == LVN_HOTTRACK)\r\n        {\r\n            SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 1);\r\n            return TRUE;\r\n        }\r\n    }\r\n    break;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can prevent the item from becoming hot-tracked.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-112057","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You can prevent the item from becoming hot-tracked.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/112057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=112057"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/112057\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=112057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=112057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=112057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}