James Hawkins : msi: Select the first item in the SelectionTree control.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Oct 4 04:25:18 CDT 2006


Module: wine
Branch: master
Commit: 7ee3a4efdf13b671dcf253fd4265d2d7f41944f1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7ee3a4efdf13b671dcf253fd4265d2d7f41944f1

Author: James Hawkins <truiken at gmail.com>
Date:   Tue Oct  3 15:00:59 2006 -0700

msi: Select the first item in the SelectionTree control.

---

 dlls/msi/dialog.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index f0c9d7c..7d60791 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -1809,7 +1809,7 @@ msi_seltree_add_child_features( MSIPACKA
 {
     MSIFEATURE *feature;
     TVINSERTSTRUCTW tvis;
-    HTREEITEM hitem;
+    HTREEITEM hitem, hfirst = NULL;
 
     LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
     {
@@ -1833,6 +1833,9 @@ msi_seltree_add_child_features( MSIPACKA
         if (!hitem)
             continue;
 
+        if (!hfirst)
+            hfirst = hitem;
+
         msi_seltree_sync_item_state( hwnd, feature, hitem );
         msi_seltree_add_child_features( package, hwnd,
                                         feature->Feature, hitem );
@@ -1841,6 +1844,9 @@ msi_seltree_add_child_features( MSIPACKA
         if ( feature->Display % 2 != 0 )
             SendMessageW( hwnd, TVM_EXPAND, TVE_EXPAND, (LPARAM) hitem );
     }
+
+    /* select the first item */
+    SendMessageW( hwnd, TVM_SELECTITEM, TVGN_CARET | TVGN_DROPHILITE, (LPARAM) hfirst );
 }
 
 static void msi_seltree_create_imagelist( HWND hwnd )




More information about the wine-cvs mailing list