Select the previous list view item when an environment variable has been deleted.
authorEric Kohl <eric.kohl@reactos.org>
Sat, 3 Nov 2007 17:14:16 +0000 (17:14 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 3 Nov 2007 17:14:16 +0000 (17:14 +0000)
svn path=/trunk/; revision=30092

reactos/dll/cpl/sysdm/environment.c

index b025755..8b97656 100644 (file)
@@ -458,6 +458,14 @@ OnDeleteVariable(HWND hwndDlg,
         }
 
         (void)ListView_DeleteItem(hwndListView, iItem);
+
+        /* Select the previous item */
+        if (iItem > 0)
+            iItem--;
+
+        ListView_SetItemState(hwndListView, iItem,
+                              LVIS_FOCUSED | LVIS_SELECTED,
+                              LVIS_FOCUSED | LVIS_SELECTED);
     }
 }