https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f95c789f2bc214cb19fb387830f65e44540d525f

commit f95c789f2bc214cb19fb387830f65e44540d525f
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Sun Nov 19 22:16:03 2023 +0900
Commit:     GitHub <[email protected]>
CommitDate: Sun Nov 19 22:16:03 2023 +0900

    [SHELL32] Select 1st item after deletion of file type (#6007)
    
    Based on KRosUser's filestypedel.patch.
    - Select the first item after the user deleted a
      file type.
    CORE-19325
---
 dll/win32/shell32/dialogs/filetypes.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dll/win32/shell32/dialogs/filetypes.cpp 
b/dll/win32/shell32/dialogs/filetypes.cpp
index ba2a5c10a42..78e5f7322ad 100644
--- a/dll/win32/shell32/dialogs/filetypes.cpp
+++ b/dll/win32/shell32/dialogs/filetypes.cpp
@@ -1612,6 +1612,12 @@ FileTypesDlg_OnDelete(HWND hwndDlg)
     if (MessageBoxW(hwndDlg, strRemoveExt, strTitle, MB_ICONQUESTION | 
MB_YESNO) == IDYES)
     {
         FileTypesDlg_RemoveExt(hwndDlg);
+
+        // Select first item (Win2k3 does it)
+        LV_ITEMW item = { LVIF_STATE };
+        item.stateMask = item.state = LVIS_FOCUSED | LVIS_SELECTED;
+        item.iItem = 0;
+        ListView_SetItem(GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW), &item);
     }
 }
 

Reply via email to