git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4780
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
// Bug in Gnu-Win32 headers, so don't use the macro TreeView_GetItemRect
RECT rect;
{
// Bug in Gnu-Win32 headers, so don't use the macro TreeView_GetItemRect
RECT rect;
- return SendMessage(GetHwnd(), TVM_GETITEMRECT, FALSE, (LPARAM)&rect) != 0;
+
+ // this ugliness comes directly from MSDN - it *is* the correct way to pass
+ // the HTREEITEM with TVM_GETITEMRECT
+ *(WXHTREEITEM *)&rect = (WXHTREEITEM)item;
+
+ // FALSE means get item rect for the whole item, not only text
+ return SendMessage(GetHwnd(), TVM_GETITEMRECT, FALSE, &rect) != 0;