Commit 908e27d6 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Store the selected item in the SelectionTree control.

parent 846fdd15
...@@ -1664,6 +1664,7 @@ struct msi_selection_tree_info ...@@ -1664,6 +1664,7 @@ struct msi_selection_tree_info
msi_dialog *dialog; msi_dialog *dialog;
HWND hwnd; HWND hwnd;
WNDPROC oldproc; WNDPROC oldproc;
HTREEITEM selected;
}; };
static void static void
...@@ -1809,6 +1810,7 @@ static void ...@@ -1809,6 +1810,7 @@ static void
msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd, msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd,
LPCWSTR parent, HTREEITEM hParent ) LPCWSTR parent, HTREEITEM hParent )
{ {
struct msi_selection_tree_info *info = GetPropW( hwnd, szButtonData );
MSIFEATURE *feature; MSIFEATURE *feature;
TVINSERTSTRUCTW tvis; TVINSERTSTRUCTW tvis;
HTREEITEM hitem, hfirst = NULL; HTREEITEM hitem, hfirst = NULL;
...@@ -1849,6 +1851,7 @@ msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd, ...@@ -1849,6 +1851,7 @@ msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd,
/* select the first item */ /* select the first item */
SendMessageW( hwnd, TVM_SELECTITEM, TVGN_CARET | TVGN_DROPHILITE, (LPARAM) hfirst ); SendMessageW( hwnd, TVM_SELECTITEM, TVGN_CARET | TVGN_DROPHILITE, (LPARAM) hfirst );
info->selected = hfirst;
} }
static void msi_seltree_create_imagelist( HWND hwnd ) static void msi_seltree_create_imagelist( HWND hwnd )
...@@ -1891,6 +1894,7 @@ static void msi_seltree_create_imagelist( HWND hwnd ) ...@@ -1891,6 +1894,7 @@ static void msi_seltree_create_imagelist( HWND hwnd )
static UINT msi_dialog_seltree_handler( msi_dialog *dialog, static UINT msi_dialog_seltree_handler( msi_dialog *dialog,
msi_control *control, WPARAM param ) msi_control *control, WPARAM param )
{ {
struct msi_selection_tree_info *info = GetPropW( control->hwnd, szButtonData );
LPNMTREEVIEWW tv = (LPNMTREEVIEWW)param; LPNMTREEVIEWW tv = (LPNMTREEVIEWW)param;
MSIRECORD *row, *rec; MSIRECORD *row, *rec;
MSIFOLDER *folder; MSIFOLDER *folder;
...@@ -1906,6 +1910,8 @@ static UINT msi_dialog_seltree_handler( msi_dialog *dialog, ...@@ -1906,6 +1910,8 @@ static UINT msi_dialog_seltree_handler( msi_dialog *dialog,
if (tv->hdr.code != TVN_SELCHANGINGW) if (tv->hdr.code != TVN_SELCHANGINGW)
return ERROR_SUCCESS; return ERROR_SUCCESS;
info->selected = tv->itemNew.hItem;
row = MSI_QueryGetRecord( dialog->package->db, select, tv->itemNew.pszText ); row = MSI_QueryGetRecord( dialog->package->db, select, tv->itemNew.pszText );
if (!row) if (!row)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment