appwiz.cpl: Check to see if buttons should be enabled.

This commit is contained in:
Owen Rudge 2008-07-21 19:42:21 +01:00 committed by Alexandre Julliard
parent 76518c0883
commit d8d725f73f
1 changed files with 16 additions and 0 deletions

View File

@ -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);
}