diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 1ee58cdb4fc..7c8f161a17e 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -1224,10 +1224,12 @@ HEADER_GetUnicodeFormat (const HEADER_INFO *infoPtr) static LRESULT HEADER_HitTest (const HEADER_INFO *infoPtr, LPHDHITTESTINFO phti) { + UINT outside = HHT_NOWHERE | HHT_ABOVE | HHT_BELOW | HHT_TOLEFT | HHT_TORIGHT; + HEADER_InternalHitTest (infoPtr, &phti->pt, &phti->flags, &phti->iItem); - if (phti->flags == HHT_NOWHERE) - return -1; + if (phti->flags & outside) + return phti->iItem = -1; else return phti->iItem; } diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index bf3960e9605..611433e3cda 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -904,6 +904,7 @@ static void test_hdm_hittest(HWND hParent) retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo); expect(0, retVal); expect(0, hdHitTestInfo.iItem); + expect(HHT_ONDIVIDER, hdHitTestInfo.flags); pt.x = secondItemRightBoundary - 1; pt.y = bottomBoundary - 1; @@ -911,15 +912,15 @@ static void test_hdm_hittest(HWND hParent) retVal = SendMessage(hChild, HDM_HITTEST, 1, (LPARAM) &hdHitTestInfo); expect(1, retVal); expect(1, hdHitTestInfo.iItem); + expect(HHT_ONDIVIDER, hdHitTestInfo.flags); pt.x = secondItemRightBoundary; pt.y = bottomBoundary + 1; hdHitTestInfo.pt = pt; - todo_wine - { - retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo); - expect(-1, retVal); - } + retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo); + expect(-1, retVal); + expect(-1, hdHitTestInfo.iItem); + expect(HHT_BELOW, hdHitTestInfo.flags); ok_sequence(sequences, HEADER_SEQ_INDEX, hittest_seq, "hittest sequence testing", FALSE);