From 4a36036eb24baac040eea64216458773c9dd6e40 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Apr 2008 20:12:57 +0000 Subject: [PATCH 1/1] don't ask for bounding rectangle of a hidden root, this fixes a crash introduced by the previous patch git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 4a8d830be2..3093583d52 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1531,7 +1531,10 @@ wxTreeItemId wxTreeCtrl::DoInsertAfter(const wxTreeItemId& parent, tvIns.item.lParam = (LPARAM)param; tvIns.item.mask = mask; - const bool firstChild = !TreeView_GetChild(GetHwnd(), HITEM(parent)); + // don't use the hack below for the children of hidden root: this results + // in a crash inside comctl32.dll when we call TreeView_GetItemRect() + const bool firstChild = !IsHiddenRoot(parent) && + !TreeView_GetChild(GetHwnd(), HITEM(parent)); HTREEITEM id = TreeView_InsertItem(GetHwnd(), &tvIns); if ( id == 0 ) -- 2.45.2