I have a CTreeCtrl. There is an interface to reorder the items in the list. The reordering works fine. I find the selected item, get its data, remove it and reinsert it at the correct spot. After I reinsert the item, I want to select the item that was moved.
m_rasterList.SetItemState(item, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
but this doesn't highlight the selected item until you click on the tree again. I also tried calling invalidate but that didn't redraw the tree correctly either.
I also tried
This works till I select another item, then old item stays highlighted but the new one becomes selected.