[COMCTL32] -Implement sending the BCN_HOTITEMCHANGE notification.
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 12 Mar 2017 00:00:40 +0000 (00:00 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 12 Mar 2017 00:00:40 +0000 (00:00 +0000)
svn path=/trunk/; revision=74150

reactos/dll/win32/comctl32/button.c

index b6f2947..687b217 100644 (file)
@@ -515,8 +515,17 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
             state = get_button_state( hWnd );
             if (state & BST_HOT)
             {
+                NMBCHOTITEM nmhotitem;
+
                 state &= ~BST_HOT;
                 set_button_state(hWnd, state);
+
+                nmhotitem.hdr.hwndFrom = hWnd;
+                nmhotitem.hdr.idFrom   = GetWindowLongPtrW (hWnd, GWLP_ID);
+                nmhotitem.hdr.code     = BCN_HOTITEMCHANGE;
+                nmhotitem.dwFlags      = HICF_LEAVING;
+                SendMessageW(GetParent(hWnd), WM_NOTIFY, nmhotitem.hdr.idFrom, (LPARAM)&nmhotitem);
+
                 InvalidateRect(hWnd, NULL, TRUE);
             }
             break;
@@ -527,8 +536,17 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
             state = get_button_state( hWnd );
             if ((state & BST_HOT) == 0)
             {
+                NMBCHOTITEM nmhotitem;
+
                 state |= BST_HOT;
                 set_button_state(hWnd, state);
+
+                nmhotitem.hdr.hwndFrom = hWnd;
+                nmhotitem.hdr.idFrom   = GetWindowLongPtrW (hWnd, GWLP_ID);
+                nmhotitem.hdr.code     = BCN_HOTITEMCHANGE;
+                nmhotitem.dwFlags      = HICF_ENTERING;
+                SendMessageW(GetParent(hWnd), WM_NOTIFY, nmhotitem.hdr.idFrom, (LPARAM)&nmhotitem);
+
                 InvalidateRect(hWnd, NULL, TRUE);
             }