Commit 6898c9e5 authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

uninstaller: Disable Uninstall button when no items selected.

parent 35c3bfe2
...@@ -286,6 +286,10 @@ static void UninstallProgram(void) ...@@ -286,6 +286,10 @@ static void UninstallProgram(void)
list_need_update = 1; list_need_update = 1;
} }
static void UpdateButtons(HWND hDlg, HWND hList)
{
EnableWindow(GetDlgItem(hDlg, IDC_UNINSTALL), SendMessageW(hList, LB_GETSELCOUNT, 0, 0) > 0);
}
static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{ {
...@@ -299,6 +303,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l ...@@ -299,6 +303,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
GetTextMetricsW(hdc, &tm); GetTextMetricsW(hdc, &tm);
UpdateList(hList); UpdateList(hList);
ReleaseDC(hwnd, hdc); ReleaseDC(hwnd, hdc);
UpdateButtons(hwnd, hList);
break; break;
case WM_COMMAND: case WM_COMMAND:
switch(LOWORD(wParam)) switch(LOWORD(wParam))
...@@ -316,6 +321,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l ...@@ -316,6 +321,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
} }
else sFilter = NULL; else sFilter = NULL;
UpdateList(hList); UpdateList(hList);
UpdateButtons(hwnd, hList);
} }
break; break;
} }
...@@ -326,6 +332,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l ...@@ -326,6 +332,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
{ {
UninstallProgram(); UninstallProgram();
UpdateList(hList); UpdateList(hList);
UpdateButtons(hwnd, hList);
} }
break; break;
} }
...@@ -344,6 +351,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l ...@@ -344,6 +351,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
wine_dbgstr_w(entries[sel].descr)); wine_dbgstr_w(entries[sel].descr));
oldsel = sel; oldsel = sel;
} }
UpdateButtons(hwnd, hList);
break; break;
case IDC_ABOUT: case IDC_ABOUT:
MessageBoxW(0, sAbout, sAboutTitle, MB_OK); MessageBoxW(0, sAbout, sAboutTitle, MB_OK);
......
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