return "no languages available" when combo box is empty of any reason, like no language with matching codepage

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5083 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-04-15 21:12:19 +00:00
parent 91fc282157
commit bfeb923c89

View file

@ -52,6 +52,12 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
selected_language = langs[i].name;
}
}
// empty list box?
if (SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_GETCOUNT, 0, 0) == 0) {
pushstring("no languages available");
EndDialog(hwndDlg, 0);
break;
}
// select the current language
if (selected_language)
SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) selected_language);