X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e45c1598999ada6caad3a9c3e051d50a14e2cc1..6631cbd98e7d1139a45841b519ae8aa753a15fbc:/src/msw/treectrl.cpp 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 )