wxTreeCtrl::IsVisible() fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-11-30 22:14:31 +00:00
parent 2f02cb8966
commit 955be36cf8

View File

@ -723,7 +723,13 @@ bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const
{
// 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;
}