From d8d725f73f5594cc95942ed48b2357dd6bf814ac Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Mon, 21 Jul 2008 19:42:21 +0100 Subject: [PATCH] appwiz.cpl: Check to see if buttons should be enabled. --- dlls/appwiz.cpl/appwiz.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c index 6f3a0830e29..4bf86a9e1ed 100644 --- a/dlls/appwiz.cpl/appwiz.c +++ b/dlls/appwiz.cpl/appwiz.c @@ -68,6 +68,20 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, return TRUE; } +/****************************************************************************** + * Name : UpdateButtons + * Description: Enables/disables the Add/Remove button depending on current + * selection in list box. + * Parameters : hWnd - Handle of the dialog box + */ +static void UpdateButtons(HWND hWnd) +{ + BOOL sel = ListView_GetSelectedCount(GetDlgItem(hWnd, IDL_PROGRAMS)) != 0; + + EnableWindow(GetDlgItem(hWnd, IDC_ADDREMOVE), sel); + EnableWindow(GetDlgItem(hWnd, IDC_SUPPORT_INFO), sel); +} + /* Definition of column headers for AddListViewColumns function */ typedef struct AppWizColumn { int width; @@ -166,6 +180,8 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm /* now create the image list and add the applications to the listview */ hImageList = AddListViewImageList(hWndListView); + UpdateButtons(hWnd); + return(hImageList); } -- 2.11.4.GIT