From d620994c178f39d3f7e2ca7a8aa3a0a112692cfe Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 19 Feb 2015 19:35:36 +0000 Subject: crash fix git-svn-id: http://svn.miranda-ng.org/main/trunk@12200 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/Options.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index f5dd37b9f9..bae5366085 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -566,8 +566,15 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case LVN_ITEMCHANGED: NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam; - EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE), TRUE); + int sel = ListView_GetSelectionMark(hwndList); + if (sel == -1) { + EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE), FALSE); + } + else { + EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE), TRUE); + } if (((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK) && !UpdateListFlag) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; -- cgit v1.2.3