Skip to content

Commit

Permalink
Fixed GroupHitTest for Vista
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot committed Sep 15, 2009
1 parent bb29aa0 commit d90d13a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CGridListCtrlEx/CGridListCtrlGroups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ int CGridListCtrlGroups::GroupHitTest(const CPoint& point)

if (IsGroupStateEnabled())
{
// Running on Vista or newer, but compiled without _WIN32_WINNT >= 0x0600
#ifndef LVM_GETGROUPINFOBYINDEX
#define LVM_GETGROUPINFOBYINDEX (LVM_FIRST + 153)
#endif
Expand All @@ -226,6 +227,9 @@ int CGridListCtrlGroups::GroupHitTest(const CPoint& point)
#endif
#ifndef LVM_GETGROUPRECT
#define LVM_GETGROUPRECT (LVM_FIRST + 98)
#endif
#ifndef LVGGR_HEADER
#define LVGGR_HEADER (1)
#endif

LRESULT groupCount = SNDMSG((m_hWnd), LVM_GETGROUPCOUNT, (WPARAM)0, (LPARAM)0);
Expand All @@ -239,8 +243,9 @@ int CGridListCtrlGroups::GroupHitTest(const CPoint& point)

VERIFY( SNDMSG((m_hWnd), LVM_GETGROUPINFOBYINDEX, (WPARAM)(i), (LPARAM)(&lg)) );

CRect rect(0,0,0,0);
CRect rect(0,LVGGR_HEADER,0,0);
VERIFY( SNDMSG((m_hWnd), LVM_GETGROUPRECT, (WPARAM)(lg.iGroupId), (LPARAM)(RECT*)(&rect)) );

if (rect.PtInRect(point))
return lg.iGroupId;
}
Expand Down

0 comments on commit d90d13a

Please sign in to comment.