Skip to content

Commit 0089017

Browse files
authored
[SHELL32] Don't close icon dialog when selecting from autocomplete (reactos#7766)
1 parent 5af47c9 commit 0089017

38 files changed

+43
-54
lines changed

dll/win32/shell32/CShellLink.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ BOOL CShellLink::OnInitDialog(HWND hwndDlg, HWND hwndFocus, LPARAM lParam)
29142914

29152915
HWND hWndTarget = GetDlgItem(hwndDlg, IDC_SHORTCUT_TARGET_TEXT);
29162916
EnableWindow(hWndTarget, !disablecontrols);
2917-
PostMessage(hWndTarget, EM_SETSEL, 0, -1); // Fix caret bug when first opening the tab
2917+
PostMessage(hWndTarget, EM_SETSEL, 0, -1); // Fix caret bug when first opening the tab [CORE-20016]
29182918

29192919
/* auto-completion */
29202920
SHAutoComplete(hWndTarget, SHACF_DEFAULT);

dll/win32/shell32/dialogs/dialogs.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@ DoLoadIcons(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext, LPCWSTR pszFile)
151151
}
152152
}
153153

154-
// Set the text and reset the edit control's modification flag
155154
SetDlgItemTextW(hwndDlg, IDC_EDIT_PATH, pIconContext->szPath);
156-
SendDlgItemMessage(hwndDlg, IDC_EDIT_PATH, EM_SETMODIFY, FALSE, 0);
155+
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, 0, 0);
157156

158157
if (pIconContext->nIcons == 0)
159158
{
@@ -194,9 +193,7 @@ INT_PTR CALLBACK PickIconProc(
194193
HICON hIcon;
195194
INT index, count;
196195
WCHAR szText[MAX_PATH], szFilter[100];
197-
CStringW strTitle;
198196
OPENFILENAMEW ofn;
199-
200197
PPICK_ICON_CONTEXT pIconContext = (PPICK_ICON_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
201198

202199
switch(uMsg)
@@ -251,18 +248,11 @@ INT_PTR CALLBACK PickIconProc(
251248
case IDOK:
252249
{
253250
/* Check whether the path edit control has been modified; if so load the icons instead of validating */
254-
if (SendDlgItemMessage(hwndDlg, IDC_EDIT_PATH, EM_GETMODIFY, 0, 0))
251+
GetDlgItemTextW(hwndDlg, IDC_EDIT_PATH, szText, _countof(szText));
252+
if (lstrcmpiW(szText, pIconContext->szPath))
255253
{
256-
/* Reset the edit control's modification flag and retrieve the text */
257-
SendDlgItemMessage(hwndDlg, IDC_EDIT_PATH, EM_SETMODIFY, FALSE, 0);
258-
GetDlgItemTextW(hwndDlg, IDC_EDIT_PATH, szText, _countof(szText));
259-
260-
// Load the icons
261254
if (!DoLoadIcons(hwndDlg, pIconContext, szText))
262255
NoIconsInFile(hwndDlg, pIconContext);
263-
264-
// Set the selection
265-
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, 0, 0);
266256
break;
267257
}
268258

@@ -293,6 +283,7 @@ INT_PTR CALLBACK PickIconProc(
293283
case IDC_BUTTON_PATH:
294284
{
295285
// Choose the module path
286+
CStringW strTitle;
296287
szText[0] = 0;
297288
szFilter[0] = 0;
298289
ZeroMemory(&ofn, sizeof(ofn));
@@ -310,9 +301,6 @@ INT_PTR CALLBACK PickIconProc(
310301
// Load the icons
311302
if (!DoLoadIcons(hwndDlg, pIconContext, szText))
312303
NoIconsInFile(hwndDlg, pIconContext);
313-
314-
// Set the selection
315-
SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, 0, 0);
316304
break;
317305
}
318306

@@ -331,8 +319,9 @@ INT_PTR CALLBACK PickIconProc(
331319
lpdis = (LPDRAWITEMSTRUCT)lParam;
332320
if (lpdis->itemID == (UINT)-1)
333321
break;
334-
switch (lpdis->itemAction)
322+
switch (lpdis->itemAction) // FIXME: MSDN says that more than one of these can be set
335323
{
324+
// FIXME: ODA_FOCUS
336325
case ODA_SELECT:
337326
case ODA_DRAWENTIRE:
338327
{

dll/win32/shell32/lang/bg-BG.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ CAPTION "Смяна на значе"
637637
FONT 8, "MS Shell Dlg", 400, 0, 0x1
638638
BEGIN
639639
LTEXT "Look for icons in this file:", -1, 7, 7, 179, 10
640-
PUSHBUTTON "Обзор...", IDC_BUTTON_PATH, 135, 17, 50, 14
641640
EDITTEXT IDC_EDIT_PATH, 7, 17, 123, 14, ES_AUTOHSCROLL
641+
PUSHBUTTON "Обзор...", IDC_BUTTON_PATH, 135, 17, 50, 14
642642
LTEXT "Select an icon from the list below:", -1, 7, 36, 179, 10
643643
LISTBOX IDC_PICKICON_LIST, 7, 47, 181, 122, LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
644644
DEFPUSHBUTTON "Добре", IDOK, 81, 179, 50, 14

dll/win32/shell32/lang/ca-ES.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ CAPTION "Change Icon"
637637
FONT 8, "MS Shell Dlg", 400, 0, 0x1
638638
BEGIN
639639
LTEXT "Look for icons in this file:", -1, 7, 7, 179, 10
640-
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
641640
EDITTEXT IDC_EDIT_PATH, 7, 17, 123, 14, ES_AUTOHSCROLL
641+
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
642642
LTEXT "Select an icon from the list below:", -1, 7, 36, 179, 10
643643
LISTBOX IDC_PICKICON_LIST, 7, 47, 181, 122, LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
644644
DEFPUSHBUTTON "OK", IDOK, 81, 179, 50, 14

dll/win32/shell32/lang/cs-CZ.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,8 @@ CAPTION "Změnit ikonu"
645645
FONT 8, "MS Shell Dlg", 400, 0, 0x1
646646
BEGIN
647647
LTEXT "Vyhledat ikony v souboru:", -1, 7, 7, 179, 10
648-
PUSHBUTTON "Procházet...", IDC_BUTTON_PATH, 135, 17, 50, 14
649648
EDITTEXT IDC_EDIT_PATH, 7, 17, 123, 14, ES_AUTOHSCROLL
649+
PUSHBUTTON "Procházet...", IDC_BUTTON_PATH, 135, 17, 50, 14
650650
LTEXT "Vyberte ikonu z následujícího seznamu:", -1, 7, 36, 179, 10
651651
LISTBOX IDC_PICKICON_LIST, 7, 47, 181, 122, LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
652652
DEFPUSHBUTTON "OK", IDOK, 81, 179, 50, 14

dll/win32/shell32/lang/da-DK.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,8 @@ CAPTION "Change Icon"
644644
FONT 8, "MS Shell Dlg", 400, 0, 0x1
645645
BEGIN
646646
LTEXT "Look for icons in this file:", -1, 7, 7, 179, 10
647-
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
648647
EDITTEXT IDC_EDIT_PATH, 7, 17, 123, 14, ES_AUTOHSCROLL
648+
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
649649
LTEXT "Select an icon from the list below:", -1, 7, 36, 179, 10
650650
LISTBOX IDC_PICKICON_LIST, 7, 47, 181, 122, LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
651651
DEFPUSHBUTTON "OK", IDOK, 81, 179, 50, 14

dll/win32/shell32/lang/de-DE.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ CAPTION "Anderes Symbol"
637637
FONT 8, "MS Shell Dlg", 400, 0, 0x1
638638
BEGIN
639639
LTEXT "Datei nach Symbolen durchsuchen:", -1, 7, 7, 179, 10
640-
PUSHBUTTON "Durchsuchen...", IDC_BUTTON_PATH, 126, 17, 59, 14
641640
EDITTEXT IDC_EDIT_PATH, 7, 17, 114, 14, ES_AUTOHSCROLL
641+
PUSHBUTTON "Durchsuchen...", IDC_BUTTON_PATH, 126, 17, 59, 14
642642
LTEXT "Wählen Sie ein Symbol aus der folgenden Liste:", -1, 7, 36, 179, 10
643643
LISTBOX IDC_PICKICON_LIST, 7, 47, 181, 122, LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
644644
DEFPUSHBUTTON "OK", IDOK, 81, 179, 50, 14

dll/win32/shell32/lang/el-GR.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ CAPTION "Change Icon"
637637
FONT 8, "MS Shell Dlg", 400, 0, 0x1
638638
BEGIN
639639
LTEXT "Look for icons in this file:", -1, 7, 7, 179, 10
640-
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
641640
EDITTEXT IDC_EDIT_PATH, 7, 17, 123, 14, ES_AUTOHSCROLL
641+
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
642642
LTEXT "Select an icon from the list below:", -1, 7, 36, 179, 10
643643
LISTBOX IDC_PICKICON_LIST, 7, 47, 181, 122, LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
644644
DEFPUSHBUTTON "OK", IDOK, 81, 179, 50, 14

dll/win32/shell32/lang/en-GB.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ CAPTION "Change Icon"
637637
FONT 8, "MS Shell Dlg", 400, 0, 0x1
638638
BEGIN
639639
LTEXT "Look for icons in this file:", -1, 7, 7, 179, 10
640-
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
641640
EDITTEXT IDC_EDIT_PATH, 7, 17, 123, 14, ES_AUTOHSCROLL
641+
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
642642
LTEXT "Select an icon from the list below:", -1, 7, 36, 179, 10
643643
LISTBOX IDC_PICKICON_LIST, 7, 47, 181, 122, LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
644644
DEFPUSHBUTTON "OK", IDOK, 81, 179, 50, 14

dll/win32/shell32/lang/en-US.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ CAPTION "Change Icon"
637637
FONT 8, "MS Shell Dlg", 400, 0, 0x1
638638
BEGIN
639639
LTEXT "Look for icons in this file:", -1, 7, 7, 179, 10
640-
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
641640
EDITTEXT IDC_EDIT_PATH, 7, 17, 123, 14, ES_AUTOHSCROLL
641+
PUSHBUTTON "Browse...", IDC_BUTTON_PATH, 135, 17, 50, 14
642642
LTEXT "Select an icon from the list below:", -1, 7, 36, 179, 10
643643
LISTBOX IDC_PICKICON_LIST, 7, 47, 181, 122, LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | LBS_DISABLENOSCROLL | WS_HSCROLL | WS_TABSTOP
644644
DEFPUSHBUTTON "OK", IDOK, 81, 179, 50, 14

0 commit comments

Comments
 (0)