Fixed up hover handling. Thanks to Jonathan Potter on Stack Overflow.

This commit is contained in:
Pietro Gagliardi 2014-08-17 17:30:25 -04:00
parent d9b9a9a743
commit 8f5df78f2a
1 changed files with 4 additions and 1 deletions

View File

@ -14,11 +14,14 @@ static void handleMouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam, void *data)
ZeroMemory(&ht, sizeof (LVHITTESTINFO)); ZeroMemory(&ht, sizeof (LVHITTESTINFO));
ht.pt.x = GET_X_LPARAM(lParam); ht.pt.x = GET_X_LPARAM(lParam);
ht.pt.y = GET_Y_LPARAM(lParam); ht.pt.y = GET_Y_LPARAM(lParam);
ht.flags = LVHT_ONITEMSTATEICON;
if (SendMessageW(hwnd, LVM_SUBITEMHITTEST, 0, (LPARAM) (&ht)) == (LRESULT) -1) { if (SendMessageW(hwnd, LVM_SUBITEMHITTEST, 0, (LPARAM) (&ht)) == (LRESULT) -1) {
tableSetHot(data, -1, -1); tableSetHot(data, -1, -1);
return; // no item return; // no item
} }
if (ht.flags != LVHT_ONITEMSTATEICON) {
tableSetHot(data, -1, -1);
return;
}
tableSetHot(data, ht.iItem, ht.iSubItem); tableSetHot(data, ht.iItem, ht.iSubItem);
} }