From 955be36cf87ac32dd0d5d98b447a3189c1573c19 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 30 Nov 1999 22:14:31 +0000 Subject: [PATCH] wxTreeCtrl::IsVisible() fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index aebe08ac39..332911d767 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -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; }