Index: main.c =================================================================== --- main.c (revision 23979) +++ main.c (working copy) @@ -200,9 +200,7 @@ item.iSelectedImage = icon; item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; - TreeView_SetItem(hTree, &item); - - return 1; + return (int)TreeView_SetItem(hTree, &item); } // Set the Icons @@ -320,9 +318,10 @@ if(item != NULL) { + BOOL fRetValue; // mark the one as seleacted SendMessage (hTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)item); - TreeView_EnsureVisible (hTree, item); + fRetValue = TreeView_EnsureVisible (hTree, item); } // create the context menu