+ // emulate them. This behaviour has changed slightly with comctl32.dll
+ // v 4.70 - now it does send them but only the first time. To maintain
+ // compatible behaviour and also in order to not have surprises with the
+ // future versions, don't rely on this and still do everything ourselves.
+ // To avoid that the messages be sent twice when the item is expanded for
+ // the first time we must clear TVIS_EXPANDEDONCE style manually.
+
+ wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_EXPANDEDONCE);
+ tvItem.state = 0;
+ DoSetItem(&tvItem);
+
+ if ( TreeView_Expand(GetHwnd(), (HTREEITEM) (WXHTREEITEM) item, flag) != 0 )