diff --git a/src/Dialogs/CollectionInterfaceDialog.cpp b/src/Dialogs/CollectionInterfaceDialog.cpp index d07c544..656aceb 100644 --- a/src/Dialogs/CollectionInterfaceDialog.cpp +++ b/src/Dialogs/CollectionInterfaceDialog.cpp @@ -27,6 +27,7 @@ #include #include #include +#include HWND g_hwndCIDlg = nullptr, g_hwndCIHlpDlg = nullptr; @@ -135,6 +136,7 @@ INT_PTR CALLBACK ciDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam switch (LOWORD(wParam)) { case IDOK: case IDC_CI_BTN_DONE: + { if (didDownload) { int ans = ::MessageBox(hwndDlg, L"Would you like to restart now?", L"Restart Needed", MB_YESNOCANCEL); switch (ans) { @@ -193,227 +195,288 @@ INT_PTR CALLBACK ciDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam } } // intentionally fall through to IDCANCEL so it exits the dialog + } case IDCANCEL: + { EndDialog(hwndDlg, 0); DestroyWindow(hwndDlg); g_hwndCIDlg = nullptr; delete pobjCI; pobjCI = NULL; return true; + } case IDC_CI_COMBO_FILE: + { if (HIWORD(wParam) == LBN_SELCHANGE) { - LRESULT selectedIndex = ::SendMessage(reinterpret_cast(lParam), LB_GETCURSEL, 0, 0); - if (selectedIndex != LB_ERR) { - LRESULT needLen = ::SendMessage(reinterpret_cast(lParam), LB_GETTEXTLEN, selectedIndex, 0); - std::wstring wsFilename(needLen, 0); - ::SendMessage(reinterpret_cast(lParam), LB_GETTEXT, selectedIndex, reinterpret_cast(wsFilename.data())); - //::MessageBox(NULL, wsFilename.c_str(), L"Which File:", MB_OK); - - // look at pobjCI->revDISPLAY[] - std::wstring ws_id_name = (pobjCI->revDISPLAY.count(wsFilename)) ? pobjCI->revDISPLAY[wsFilename] : L"!!DoesNotExist!!"; - HWND hwCHK = GetDlgItem(hwndDlg, IDC_CI_CHK_ALSO_AC); - EnableWindow(hwCHK, static_cast(pobjCI->mapAC.count(ws_id_name))); - hwCHK = GetDlgItem(hwndDlg, IDC_CI_CHK_ALSO_FL); - EnableWindow(hwCHK, static_cast(pobjCI->mapFL.count(ws_id_name))); - + std::vector vBuf; + LRESULT selectionCount = ::SendMessage(reinterpret_cast(lParam), LB_GETSELCOUNT, 0, 0); + if (selectionCount == LB_ERR) { // gives error on single-selection + selectionCount = 1; + vBuf.resize(selectionCount); + LRESULT selectedIndex = ::SendMessage(reinterpret_cast(lParam), LB_GETCURSEL, 0, 0); + vBuf[0] = static_cast(selectedIndex); + } + else { + vBuf.resize(selectionCount); + LRESULT stat = ::SendMessage(reinterpret_cast(lParam), LB_GETSELITEMS, selectionCount, reinterpret_cast(vBuf.data())); + if (stat == LB_ERR) { + for (int b = 0; b < selectionCount; b++) + vBuf[b] = static_cast(stat); + } + } + // start with assuming disabled checkboxes + bool anyAC = false, anyFL = false; + // then go through each selection item, and update flag as needed + for (auto selectedIndex: vBuf) { + if (selectedIndex != LB_ERR) { + LRESULT needLen = ::SendMessage(reinterpret_cast(lParam), LB_GETTEXTLEN, selectedIndex, 0); + std::wstring wsFilename(needLen, 0); + ::SendMessage(reinterpret_cast(lParam), LB_GETTEXT, selectedIndex, reinterpret_cast(wsFilename.data())); + //::MessageBox(NULL, wsFilename.c_str(), L"Which File:", MB_OK); + + // look at pobjCI->revDISPLAY[] + std::wstring ws_id_name = (pobjCI->revDISPLAY.count(wsFilename)) ? pobjCI->revDISPLAY[wsFilename] : L"!!DoesNotExist!!"; + anyAC |= static_cast(pobjCI->mapAC.count(ws_id_name)); + anyFL |= static_cast(pobjCI->mapFL.count(ws_id_name)); + } } + EnableWindow(GetDlgItem(hwndDlg, IDC_CI_CHK_ALSO_AC), anyAC); + EnableWindow(GetDlgItem(hwndDlg, IDC_CI_CHK_ALSO_FL), anyFL); + // reset progress bar ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 0, 0); Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), L"READY"); } return true; + } case IDC_CI_BTN_DOWNLOAD: { std::wstring wsCategory = _get_tab_category_wstr(hwndDlg, IDC_CI_TABCTRL); - LRESULT selectedFileIndex = ::SendDlgItemMessage(hwndDlg, IDC_CI_COMBO_FILE, LB_GETCURSEL, 0, 0); - if (selectedFileIndex == CB_ERR) { - ::MessageBox(NULL, L"Could not understand name selection; sorry", L"Download Error", MB_ICONERROR); - return true; - } - - LRESULT needFileLen = ::SendDlgItemMessage(hwndDlg, IDC_CI_COMBO_FILE, LB_GETTEXTLEN, selectedFileIndex, 0); - if (needFileLen == LB_ERR) { - ::MessageBox(NULL, L"Could not understand name selection; sorry", L"Download Error", MB_ICONERROR); - return true; + HWND hwLBFile = GetDlgItem(hwndDlg, IDC_CI_COMBO_FILE); + + // prepare for N selections + std::vector vBuf; + LRESULT selectionCount = ::SendMessage(hwLBFile, LB_GETSELCOUNT, 0, 0); + if (selectionCount == LB_ERR) { // gives error on single-selection + selectionCount = 1; + vBuf.resize(selectionCount); + LRESULT selectedIndex = ::SendMessage(hwLBFile, LB_GETCURSEL, 0, 0); + vBuf[0] = static_cast(selectedIndex); } - std::wstring wsFilename(needFileLen, 0); - ::SendDlgItemMessage(hwndDlg, IDC_CI_COMBO_FILE, LB_GETTEXT, selectedFileIndex, reinterpret_cast(wsFilename.data())); - - // update progress bar - ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 0, 0); - Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), L"Downloading... 0%"); - - int total = 1; - std::wstring ws_id_name = (pobjCI->revDISPLAY.count(wsFilename)) ? pobjCI->revDISPLAY[wsFilename] : L"!!DoesNotExist!!"; - std::wstring wsURL = L""; - std::wstring wsPath = L""; - bool isWritable = false; - std::map> alsoDownload; - std::map extraWritable; - if (wsCategory == L"UDL") { - if (pobjCI->mapUDL.count(ws_id_name)) { - wsURL = pobjCI->mapUDL[ws_id_name]; + else { + vBuf.resize(selectionCount); + LRESULT stat = ::SendMessage(hwLBFile, LB_GETSELITEMS, selectionCount, reinterpret_cast(vBuf.data())); + if (stat == LB_ERR) { + for (int b = 0; b < selectionCount; b++) + vBuf[b] = static_cast(stat); } + } - wsPath = pobjCI->nppCfgUdlDir() + L"\\" + ws_id_name + L".xml"; - isWritable = pobjCI->isUdlDirWritable(); - - // if chkAC, then also download AC - bool isCHK = BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_CI_CHK_ALSO_AC); - bool isEN = IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CI_CHK_ALSO_AC)); - if (isEN && isCHK && pobjCI->mapAC.count(ws_id_name)) { - alsoDownload[L"AC"][L"URL"] = pobjCI->mapAC[ws_id_name]; - size_t posLastSlash = alsoDownload[L"AC"][L"URL"].rfind(L'/'); - std::wstring acName = (posLastSlash == std::wstring::npos) ? (ws_id_name + L".xml") : (alsoDownload[L"AC"][L"URL"].substr(posLastSlash + 1)); - alsoDownload[L"AC"][L"PATH"] = pobjCI->nppCfgAutoCompletionDir() + L"\\" + acName; - extraWritable[L"AC"] = pobjCI->isAutoCompletionDirWritable(); - total++; + // loop through each index in the buffer, and download as needed + std::map mapUacDelayed; + for(auto selectedFileIndex: vBuf) { + if (selectedFileIndex == LB_ERR) { + ::MessageBox(NULL, L"Could not understand name selection; sorry", L"Download Error", MB_ICONERROR); + return true; } - // if cjkFL, then also download FL - isCHK = BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_CI_CHK_ALSO_FL); - isEN = IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CI_CHK_ALSO_FL)); - if (isEN && isCHK && pobjCI->mapFL.count(ws_id_name)) { - alsoDownload[L"FL"][L"URL"] = pobjCI->mapFL[ws_id_name]; - alsoDownload[L"FL"][L"PATH"] = pobjCI->nppCfgFunctionListDir() + L"\\" + ws_id_name + L".xml"; - extraWritable[L"FL"] = pobjCI->isFunctionListDirWritable(); - total++; + LRESULT needFileLen = ::SendMessage(hwLBFile, LB_GETTEXTLEN, selectedFileIndex, 0); + if (needFileLen == LB_ERR) { + ::MessageBox(NULL, L"Could not understand name selection; sorry", L"Download Error", MB_ICONERROR); + return true; } - } - else if (wsCategory == L"AutoCompletion") { - size_t posLastSlash = std::wstring::npos; - std::wstring acName = ws_id_name + L".xml"; - if (pobjCI->mapAC.count(ws_id_name)) { - wsURL = pobjCI->mapAC[ws_id_name]; - posLastSlash = wsURL.rfind(L'/'); - if (posLastSlash != std::wstring::npos) { - acName = wsURL.substr(posLastSlash + 1); + std::wstring wsFilename(needFileLen, 0); + ::SendMessage(hwLBFile, LB_GETTEXT, selectedFileIndex, reinterpret_cast(wsFilename.data())); + + // update progress bar + ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 0, 0); + Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), L"Downloading... 0%"); + + int total = 1; + std::wstring ws_id_name = (pobjCI->revDISPLAY.count(wsFilename)) ? pobjCI->revDISPLAY[wsFilename] : L"!!DoesNotExist!!"; + std::wstring wsURL = L""; + std::wstring wsPath = L""; + bool isWritable = false; + std::map> alsoDownload; + std::map extraWritable; + if (wsCategory == L"UDL") { + if (pobjCI->mapUDL.count(ws_id_name)) { + wsURL = pobjCI->mapUDL[ws_id_name]; + } + + wsPath = pobjCI->nppCfgUdlDir() + L"\\" + ws_id_name + L".xml"; + isWritable = pobjCI->isUdlDirWritable(); + + // if chkAC, then also download AC + bool isCHK = BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_CI_CHK_ALSO_AC); + bool isEN = IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CI_CHK_ALSO_AC)); + if (isEN && isCHK && pobjCI->mapAC.count(ws_id_name)) { + alsoDownload[L"AC"][L"URL"] = pobjCI->mapAC[ws_id_name]; + size_t posLastSlash = alsoDownload[L"AC"][L"URL"].rfind(L'/'); + std::wstring acName = (posLastSlash == std::wstring::npos) ? (ws_id_name + L".xml") : (alsoDownload[L"AC"][L"URL"].substr(posLastSlash + 1)); + alsoDownload[L"AC"][L"PATH"] = pobjCI->nppCfgAutoCompletionDir() + L"\\" + acName; + extraWritable[L"AC"] = pobjCI->isAutoCompletionDirWritable(); + total++; + } + + // if cjkFL, then also download FL + isCHK = BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_CI_CHK_ALSO_FL); + isEN = IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CI_CHK_ALSO_FL)); + if (isEN && isCHK && pobjCI->mapFL.count(ws_id_name)) { + alsoDownload[L"FL"][L"URL"] = pobjCI->mapFL[ws_id_name]; + alsoDownload[L"FL"][L"PATH"] = pobjCI->nppCfgFunctionListDir() + L"\\" + ws_id_name + L".xml"; + extraWritable[L"FL"] = pobjCI->isFunctionListDirWritable(); + total++; } } + else if (wsCategory == L"AutoCompletion") { + size_t posLastSlash = std::wstring::npos; + std::wstring acName = ws_id_name + L".xml"; + if (pobjCI->mapAC.count(ws_id_name)) { + wsURL = pobjCI->mapAC[ws_id_name]; + posLastSlash = wsURL.rfind(L'/'); + if (posLastSlash != std::wstring::npos) { + acName = wsURL.substr(posLastSlash + 1); + } + } - wsPath = pobjCI->nppCfgAutoCompletionDir() + L"\\" + acName; - isWritable = pobjCI->isAutoCompletionDirWritable(); - } - else if (wsCategory == L"FunctionList") { - if (pobjCI->mapFL.count(ws_id_name)) { - wsURL = pobjCI->mapFL[ws_id_name]; + wsPath = pobjCI->nppCfgAutoCompletionDir() + L"\\" + acName; + isWritable = pobjCI->isAutoCompletionDirWritable(); } + else if (wsCategory == L"FunctionList") { + if (pobjCI->mapFL.count(ws_id_name)) { + wsURL = pobjCI->mapFL[ws_id_name]; + } - wsPath = pobjCI->nppCfgFunctionListDir() + L"\\" + ws_id_name + L".xml"; - isWritable = pobjCI->isFunctionListDirWritable(); - } - else if (wsCategory == L"Theme") { - wsURL = L"https://raw.githubusercontent.com/notepad-plus-plus/nppThemes/main/themes/" + wsFilename; + wsPath = pobjCI->nppCfgFunctionListDir() + L"\\" + ws_id_name + L".xml"; + isWritable = pobjCI->isFunctionListDirWritable(); + } + else if (wsCategory == L"Theme") { + wsURL = L"https://raw.githubusercontent.com/notepad-plus-plus/nppThemes/main/themes/" + wsFilename; - wsPath = pobjCI->nppCfgThemesDir() + L"\\" + wsFilename; - isWritable = pobjCI->isThemesDirWritable(); - } + wsPath = pobjCI->nppCfgThemesDir() + L"\\" + wsFilename; + isWritable = pobjCI->isThemesDirWritable(); + } - int count = 0; - if (isWritable) { - // download directly to the final destination - didDownload |= pobjCI->downloadFileToDisk(wsURL, wsPath); - std::wstring msg = L"Downloaded to " + wsPath; - //::MessageBox(hwndDlg, msg.c_str(), L"Download Successful", MB_OK); - count++; - } - else { - // check if it needs to be overwritten before elevating permissions - if (pobjCI->ask_overwrite_if_exists(wsPath)) { - // download to a temp path, then use ShellExecute(runas) to move it from the temp path to the final destination - std::wstring wsAsk = L"Cannot write to " + wsPath; - wsAsk += L"\nI will try again with elevated UAC permission."; - int ans = ::MessageBox(hwndDlg, wsAsk.c_str(), L"Need Directory Permission", MB_OKCANCEL); - if (ans == IDOK) { - std::wstring tmpPath = pobjCI->getWritableTempDir() + L"\\~$TMPFILE.DOWNLOAD.PRYRT.xml"; - pobjCI->downloadFileToDisk(wsURL, tmpPath); - std::wstring msg = L"Downloaded from\n" + tmpPath + L"\nand moved to\n" + wsPath; - std::wstring args = L"/C MOVE /Y \"" + tmpPath + L"\" \"" + wsPath + L"\""; - ShellExecute(hwndDlg, L"runas", L"cmd.exe", args.c_str(), NULL, SW_SHOWMINIMIZED); - //::MessageBox(hwndDlg, msg.c_str(), L"Download and UAC move", MB_OK); - count++; - didDownload = true; + int count = 0; + if (isWritable) { + // download directly to the final destination + didDownload |= pobjCI->downloadFileToDisk(wsURL, wsPath); + std::wstring msg = L"Downloaded to " + wsPath; + //::MessageBox(hwndDlg, msg.c_str(), L"Download Successful", MB_OK); + count++; + } + else { + // check if it needs to be overwritten before elevating permissions + if (pobjCI->ask_overwrite_if_exists(wsPath)) { + mapUacDelayed[wsURL] = wsPath; + total--; } else { total--; } } - else { - total--; - } - } - // update progress bar - wchar_t wcDLPCT[256]; - swprintf_s(wcDLPCT, L"Downloading %d%%", 100 * count / total); - if (didDownload) { - ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 100 * count / total, 0); - Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); - } + // update progress bar + wchar_t wcDLPCT[256]; + if (total < 1) total = 1; + swprintf_s(wcDLPCT, L"Downloading %d%%", 100 * count / total); + if (didDownload) { + ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 100 * count / total, 0); + Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); + } - // also download AC and FL, if applicable - std::vector xtra = { L"AC", L"FL" }; - for (auto category : xtra) { - if (alsoDownload.count(category)) { - std::wstring xURL = alsoDownload[category][L"URL"]; - std::wstring xPath = alsoDownload[category][L"PATH"]; - if (extraWritable[category]) { - pobjCI->downloadFileToDisk(xURL, xPath); - count++; - didDownload = true; - } - else { - if (pobjCI->ask_overwrite_if_exists(xPath)) { - // download to a temp path, then use ShellExecute(runas) to move it from the temp path to the final destination - std::wstring wsAsk = L"Cannot write to " + xPath; - wsAsk += L"\nI will try again with elevated UAC permission."; - int ans = ::MessageBox(hwndDlg, wsAsk.c_str(), L"Need Directory Permission", MB_OKCANCEL); - if (ans == IDOK) { - std::wstring tmpPath = pobjCI->getWritableTempDir() + L"\\~$TMPFILE.DOWNLOAD.PRYRT.xml"; - pobjCI->downloadFileToDisk(xURL, tmpPath); - std::wstring msg = L"Downloaded from\n" + tmpPath + L"\nand moved to\n" + xPath; - std::wstring args = L"/C MOVE /Y \"" + tmpPath + L"\" \"" + xPath + L"\""; - ShellExecute(hwndDlg, L"runas", L"cmd.exe", args.c_str(), NULL, SW_SHOWMINIMIZED); - count++; - didDownload = true; + // also download AC and FL, if applicable + std::vector xtra = { L"AC", L"FL" }; + for (auto category : xtra) { + if (alsoDownload.count(category)) { + std::wstring xURL = alsoDownload[category][L"URL"]; + std::wstring xPath = alsoDownload[category][L"PATH"]; + if (extraWritable[category]) { + pobjCI->downloadFileToDisk(xURL, xPath); + count++; + didDownload = true; + } + else { + if (pobjCI->ask_overwrite_if_exists(xPath)) { + mapUacDelayed[xURL] = xPath; + total--; } else { total--; } } - else { - total--; - } + } + // update progress bar + if (total < 1) total = 1; + swprintf_s(wcDLPCT, L"Downloading %d%%", 100 * count / total); + if (didDownload) { + ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 100 * count / total, 0); + Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); } } - // update progress bar - swprintf_s(wcDLPCT, L"Downloading %d%%", 100 * count / total); + + // Final update of progress bar: 100% if (didDownload) { - ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 100 * count / total, 0); + ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 100, 0); + swprintf_s(wcDLPCT, L"Downloading %d%% [DONE]", 100); + Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); + } + else { + ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 0, 0); + swprintf_s(wcDLPCT, L"Nothing to Download. [DONE]"); Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); } } - // Final update of progress bar: 100% - if (didDownload) { - ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 100, 0); - swprintf_s(wcDLPCT, L"Downloading %d%% [DONE]", 100); - Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); - } - else { - ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 0, 0); - swprintf_s(wcDLPCT, L"Nothing to Download. [DONE]"); - Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); + if (mapUacDelayed.size()) { + int total = static_cast(mapUacDelayed.size()) + 1; // want one extra "slot" for the MOVE command + int count = 0; + std::wstring wsAsk = L"Cannot write the following files:"; + for (const auto& pair : mapUacDelayed) { + wsAsk += std::wstring(L"\n") + pair.second; + } + wsAsk += L"\n\nI will download temporary files, and then try to copy them to the right location with elevated UAC permission. (The OS may prompt you for UAC.)"; + int ans = ::MessageBox(hwndDlg, wsAsk.c_str(), L"Need Directory Permission", MB_OKCANCEL); + if (ans == IDOK) { + wchar_t wcDLPCT[256]; + swprintf_s(wcDLPCT, L"Downloading %d%%", 100 * count / total); + Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); + + std::wstring args = L"/C "; + + for (const auto& pair : mapUacDelayed) { + ++count; + std::wstring tmpPath = pobjCI->getWritableTempDir() + L"\\~$TMPFILE.DOWNLOAD.PRYRT." + std::to_wstring(count); + pobjCI->downloadFileToDisk(pair.first, tmpPath); + didDownload = true; + args += L"MOVE /Y \"" + tmpPath + L"\" \"" + pair.second + L"\" & "; + + ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 100 * count / total, 0); + swprintf_s(wcDLPCT, L"Downloading %d%%", 100 * count / total); + Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); + } + + //::MessageBox(hwndDlg, (std::wstring(L"cmd.exe ") + args).c_str(), L"TODO: UAC Command", MB_OK); + ShellExecute(hwndDlg, L"runas", L"cmd.exe", args.c_str(), NULL, SW_SHOWMINIMIZED); + + ::SendDlgItemMessage(hwndDlg, IDC_CI_PROGRESSBAR, PBM_SETPOS, 100, 0); + swprintf_s(wcDLPCT, L"Downloading %d%% [DONE]", 100); + Edit_SetText(GetDlgItem(hwndDlg, IDC_CI_PROGRESSLBL), wcDLPCT); + } } + + return true; } - return true; case IDC_CI_HELPBTN: { showCIDownloadHelp(); + return true; } - return true; default: + { return false; + } } case WM_NOTIFY: { diff --git a/src/Dialogs/CollectionInterfaceDialog.rc b/src/Dialogs/CollectionInterfaceDialog.rc index c73d1f3..d55e924 100644 --- a/src/Dialogs/CollectionInterfaceDialog.rc +++ b/src/Dialogs/CollectionInterfaceDialog.rc @@ -32,7 +32,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN LTEXT "Download files from UDL Collection or Themes Collection", IDC_STATIC, 10, 5, 280, 9, SS_LEFT, WS_EX_LEFT CONTROL "",IDC_CI_TABCTRL,"SysTabControl32",0x0,10,17,280,148 - LISTBOX IDC_CI_COMBO_FILE, 13, 32, 272, 120, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_CI_COMBO_FILE, 13, 32, 272, 120, LBS_NOTIFY | LBS_SORT | LBS_EXTENDEDSEL | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP CHECKBOX "Also AutoCompletion", IDC_CI_CHK_ALSO_AC, 13, 140, 100, 11, WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX CHECKBOX "Also FunctionList", IDC_CI_CHK_ALSO_FL, 13, 151, 100, 11, WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX PUSHBUTTON "&Download", IDC_CI_BTN_DOWNLOAD, 120, 140, 60, 22