diff --git a/matepath/src/Dialogs.cpp b/matepath/src/Dialogs.cpp index ce7662a857..6fab9b959e 100644 --- a/matepath/src/Dialogs.cpp +++ b/matepath/src/Dialogs.cpp @@ -374,11 +374,9 @@ INT_PTR CALLBACK GotoDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) } } - // from WinUser.h: GetComboBoxInfo() since Windows Vista, but CB_GETCOMBOBOXINFO since Windows XP. COMBOBOXINFO cbi; - memset(&cbi, 0, sizeof(COMBOBOXINFO)); cbi.cbSize = sizeof(COMBOBOXINFO); - if (SendMessage(hwndGoto, CB_GETCOMBOBOXINFO, 0, AsInteger(&cbi))) { + if (GetComboBoxInfo(hwndGoto, &cbi)) { SHAutoComplete(cbi.hwndItem, SHACF_FILESYSTEM); } CenterDlgInParent(hwnd); diff --git a/src/Edit.cpp b/src/Edit.cpp index b75637bd05..ef3ad5ced0 100644 --- a/src/Edit.cpp +++ b/src/Edit.cpp @@ -4590,12 +4590,13 @@ static LRESULT CALLBACK AddBackslashEditProc(HWND hwnd, UINT umsg, WPARAM wParam return DefSubclassProc(hwnd, umsg, wParam, lParam); } -void AddBackslashComboBoxSetup(HWND hwndDlg, int nCtlId) noexcept { - HWND hwnd = GetDlgItem(hwndDlg, nCtlId); +void AddBackslashComboBoxSetup(HWND hwnd) noexcept { COMBOBOXINFO info; info.cbSize = sizeof(COMBOBOXINFO); if (GetComboBoxInfo(hwnd, &info)) { SetWindowSubclass(info.hwndItem, AddBackslashEditProc, 0, 0); + // Ctrl+Backspace + SHAutoComplete(info.hwndItem, SHACF_FILESYS_ONLY | SHACF_AUTOAPPEND_FORCE_OFF | SHACF_AUTOSUGGEST_FORCE_OFF); } } @@ -4734,7 +4735,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar ResizeDlg_InitX(hwnd, cxFindReplaceDlg, IDC_RESIZEGRIP2); HWND hwndFind = GetDlgItem(hwnd, IDC_FINDTEXT); - AddBackslashComboBoxSetup(hwnd, IDC_FINDTEXT); + AddBackslashComboBoxSetup(hwndFind); // Load MRUs mruFind.AddToCombobox(hwndFind); @@ -4754,7 +4755,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar HWND hwndRepl = GetDlgItem(hwnd, IDC_REPLACETEXT); if (hwndRepl) { - AddBackslashComboBoxSetup(hwnd, IDC_REPLACETEXT); + AddBackslashComboBoxSetup(hwndRepl); mruReplace.AddToCombobox(hwndRepl); ComboBox_LimitText(hwndRepl, NP2_FIND_REPLACE_LIMIT); ComboBox_SetExtendedUI(hwndRepl, TRUE); diff --git a/src/Helpers.cpp b/src/Helpers.cpp index 0f01d4c3e6..17e23153de 100644 --- a/src/Helpers.cpp +++ b/src/Helpers.cpp @@ -1240,7 +1240,10 @@ static LRESULT CALLBACK MultilineEditProc(HWND hwnd, UINT umsg, WPARAM wParam, L } void MultilineEditSetup(HWND hwndDlg, int nCtlId) noexcept { - SetWindowSubclass(GetDlgItem(hwndDlg, nCtlId), MultilineEditProc, 0, 0); + HWND hwnd = GetDlgItem(hwndDlg, nCtlId); + SetWindowSubclass(hwnd, MultilineEditProc, 0, 0); + // Ctrl+Backspace + SHAutoComplete(hwnd, SHACF_FILESYS_ONLY | SHACF_AUTOAPPEND_FORCE_OFF | SHACF_AUTOSUGGEST_FORCE_OFF); } //=============================================================================