list services
Modified: trunk/reactos/subsys/system/msconfig/De.rc
Modified: trunk/reactos/subsys/system/msconfig/En.rc
Modified: trunk/reactos/subsys/system/msconfig/msconfig.c
Modified: trunk/reactos/subsys/system/msconfig/resource.h
Modified: trunk/reactos/subsys/system/msconfig/srvpage.c

Modified: trunk/reactos/subsys/system/msconfig/De.rc
--- trunk/reactos/subsys/system/msconfig/De.rc	2005-11-10 21:29:00 UTC (rev 19125)
+++ trunk/reactos/subsys/system/msconfig/De.rc	2005-11-10 22:46:41 UTC (rev 19126)
@@ -34,12 +34,13 @@
 STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN
 FONT 8, "Tahoma"
 BEGIN
-    CONTROL "List1",IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168
+    CONTROL "List1",IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168
 END
 
 STRINGTABLE DISCARDABLE
 BEGIN
     IDS_TAB_GENERAL          "Allgemein"
+    IDS_TAB_SYSTEM           "SYSTEM.INI"
     IDS_TAB_FREELDR          "FREELDR.INI"   
     IDS_TAB_SERVICES         "Dienste" 
     IDS_TAB_STARTUP          "Systemstart" 

Modified: trunk/reactos/subsys/system/msconfig/En.rc
--- trunk/reactos/subsys/system/msconfig/En.rc	2005-11-10 21:29:00 UTC (rev 19125)
+++ trunk/reactos/subsys/system/msconfig/En.rc	2005-11-10 22:46:41 UTC (rev 19126)
@@ -34,12 +34,13 @@
 STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN
 FONT 8, "Tahoma"
 BEGIN
-    CONTROL "List1",IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168
+    CONTROL "List1",IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 2, 1, 360, 168
 END
 
 STRINGTABLE DISCARDABLE
 BEGIN
     IDS_TAB_GENERAL          "General"
+    IDS_TAB_SYSTEM           "SYSTEM.INI"
     IDS_TAB_FREELDR          "FREELDR.INI"   
     IDS_TAB_SERVICES         "Services" 
     IDS_TAB_STARTUP          "Startup" 

Modified: trunk/reactos/subsys/system/msconfig/msconfig.c
--- trunk/reactos/subsys/system/msconfig/msconfig.c	2005-11-10 21:29:00 UTC (rev 19125)
+++ trunk/reactos/subsys/system/msconfig/msconfig.c	2005-11-10 22:46:41 UTC (rev 19126)
@@ -23,30 +23,36 @@
     item.pszText = szTemp;
     TabCtrl_InsertItem(hTabWnd, 0, &item);
 
-	LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256);
+	LoadString(hInst, IDS_TAB_SYSTEM, szTemp, 256);
     memset(&item, 0, sizeof(TCITEM));
     item.mask = TCIF_TEXT;
     item.pszText = szTemp;
     TabCtrl_InsertItem(hTabWnd, 1, &item);
 
-	LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256);
+	LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256);
     memset(&item, 0, sizeof(TCITEM));
     item.mask = TCIF_TEXT;
     item.pszText = szTemp;
     TabCtrl_InsertItem(hTabWnd, 2, &item);
 
-	LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256);
+	LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256);
     memset(&item, 0, sizeof(TCITEM));
     item.mask = TCIF_TEXT;
     item.pszText = szTemp;
     TabCtrl_InsertItem(hTabWnd, 3, &item);
 
-	LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256);
+	LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256);
     memset(&item, 0, sizeof(TCITEM));
     item.mask = TCIF_TEXT;
     item.pszText = szTemp;
     TabCtrl_InsertItem(hTabWnd, 4, &item);
 
+	LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256);
+    memset(&item, 0, sizeof(TCITEM));
+    item.mask = TCIF_TEXT;
+    item.pszText = szTemp;
+    TabCtrl_InsertItem(hTabWnd, 5, &item);
+
 	return TRUE;
 }
 
@@ -61,28 +67,35 @@
 		ShowWindow(hServicesPage, SW_HIDE);
         //BringWindowToTop(hFreeLdrPage);
 		break;
-    case 1: //Freeldr
+    case 1: //SYSTEM.INI
         ShowWindow(hToolsPage, SW_HIDE);
 		ShowWindow(hStartupPage, SW_HIDE);
 		//ShowWindow(hFreeLdrPage, SW_SHOW);
 		ShowWindow(hServicesPage, SW_HIDE);
         //BringWindowToTop(hFreeLdrPage);
 		break;
-    case 2: //Services
+    case 2: //Freeldr
         ShowWindow(hToolsPage, SW_HIDE);
 		ShowWindow(hStartupPage, SW_HIDE);
+		//ShowWindow(hFreeLdrPage, SW_SHOW);
+		ShowWindow(hServicesPage, SW_HIDE);
+        //BringWindowToTop(hFreeLdrPage);
+		break;
+    case 3: //Services
+        ShowWindow(hToolsPage, SW_HIDE);
+		ShowWindow(hStartupPage, SW_HIDE);
 		//ShowWindow(hFreeLdrPage, SW_HIDE);
 		ShowWindow(hServicesPage, SW_SHOW);
-        //BringWindowToTop(hFreeLdrPage);
+        BringWindowToTop(hServicesPage);
 		break;
-    case 3: //startup
+    case 4: //startup
         ShowWindow(hToolsPage, SW_HIDE);
 		ShowWindow(hStartupPage, SW_SHOW);
 		//ShowWindow(hFreeLdrPage, SW_HIDE);
 		ShowWindow(hServicesPage, SW_HIDE);
         BringWindowToTop(hStartupPage);
 		break;
-	case 4: //Tools
+	case 5: //Tools
         ShowWindow(hToolsPage, SW_SHOW);
 		ShowWindow(hStartupPage, SW_HIDE);
 		//ShowWindow(hFreeLdrPage, SW_HIDE);

Modified: trunk/reactos/subsys/system/msconfig/resource.h
--- trunk/reactos/subsys/system/msconfig/resource.h	2005-11-10 21:29:00 UTC (rev 19125)
+++ trunk/reactos/subsys/system/msconfig/resource.h	2005-11-10 22:46:41 UTC (rev 19126)
@@ -14,19 +14,20 @@
 #define IDC_STARTUP_LIST                1008
 
 #define IDS_TAB_TOOLS                   2001
-#define IDS_TAB_FREELDR                 2002
-#define IDS_TAB_STARTUP                 2003
-#define IDS_TAB_SERVICES                2004
-#define IDS_TAB_GENERAL                 2005
+#define IDS_TAB_SYSTEM                  2002
+#define IDS_TAB_FREELDR                 2003
+#define IDS_TAB_STARTUP                 2004
+#define IDS_TAB_SERVICES                2005
+#define IDS_TAB_GENERAL                 2006
 
 #define IDS_TOOLS_COLUMN_NAME           2010
 #define IDS_TOOLS_COLUMN_DESCR          2011
 #define IDS_SERVICES_COLUMN_SERVICE     2012
 #define IDS_SERVICES_COLUMN_VENDOR      2013
 #define IDS_SERVICES_COLUMN_STATUS      2014
-#define IDS_STARTUP_COLUMN_ELEMENT     2015
-#define IDS_STARTUP_COLUMN_CMD         2016
-#define IDS_STARTUP_COLUMN_PATH        2017
+#define IDS_STARTUP_COLUMN_ELEMENT      2015
+#define IDS_STARTUP_COLUMN_CMD          2016
+#define IDS_STARTUP_COLUMN_PATH         2017
 
 #define IDS_TOOLS_CMD_NAME              2100
 #define IDS_TOOLS_CMD_DESCR             2101

Modified: trunk/reactos/subsys/system/msconfig/srvpage.c
--- trunk/reactos/subsys/system/msconfig/srvpage.c	2005-11-10 21:29:00 UTC (rev 19125)
+++ trunk/reactos/subsys/system/msconfig/srvpage.c	2005-11-10 22:46:41 UTC (rev 19126)
@@ -4,6 +4,8 @@
 HWND hServicesListCtrl;
 HWND hServicesDialog;
 
+void GetServices ( void );
+
 INT_PTR CALLBACK
 ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 {
@@ -28,7 +30,7 @@
 
         LoadString(hInst, IDS_SERVICES_COLUMN_SERVICE, szTemp, 256);
         column.pszText = szTemp;
-        column.cx = 150;
+        column.cx = 200;
         ListView_InsertColumn(hServicesListCtrl, 0, &column);
 
         column.mask = LVCF_TEXT | LVCF_WIDTH;
@@ -43,8 +45,60 @@
         column.cx = 70;
         ListView_InsertColumn(hServicesListCtrl, 2, &column);
 
+        GetServices();
 		return TRUE;
 	}
 
   return 0;
 }
+
+void
+GetServices ( void )
+{
+    HKEY hKey, hSubKey;
+    DWORD dwSubKeys, dwKeyLength;
+    DWORD dwType, dwDataLength;
+    size_t Index;
+    TCHAR lpKeyName[MAX_KEY_LENGTH];
+    TCHAR lpSubKey[MAX_KEY_LENGTH];
+    TCHAR DisplayName[MAX_VALUE_NAME];
+    TCHAR ObjectName[MAX_VALUE_NAME];
+    TCHAR lpServicesKey[MAX_KEY_LENGTH] = _T("SYSTEM\\CurrentControlSet\\Services");
+    LV_ITEM item;
+
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpServicesKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
+    {
+        if (RegQueryInfoKey(hKey, NULL, NULL, NULL, &dwSubKeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
+        {
+            for (Index = 0; Index < dwSubKeys; Index++) 
+            { 
+                dwKeyLength = MAX_KEY_LENGTH;
+                if (RegEnumKeyEx(hKey, Index, lpKeyName, &dwKeyLength, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
+                {
+                    _tcscpy(lpSubKey, lpServicesKey);
+                    _tcscat(lpSubKey, _T("\\"));
+                    _tcscat(lpSubKey, lpKeyName);
+                    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ, &hSubKey) == ERROR_SUCCESS)
+                    {
+                        dwDataLength = MAX_VALUE_NAME;
+                        if (RegQueryValueEx(hSubKey, _T("ObjectName"), NULL, &dwType, (LPBYTE)ObjectName, &dwDataLength) == ERROR_SUCCESS)
+                        {
+                            dwDataLength = MAX_VALUE_NAME;
+                            if (RegQueryValueEx(hSubKey, _T("DisplayName"), NULL, &dwType, (LPBYTE)DisplayName, &dwDataLength) == ERROR_SUCCESS)
+                            {
+                                memset(&item, 0, sizeof(LV_ITEM));
+                                item.mask = LVIF_TEXT;
+                                item.iImage = 0;
+                                item.pszText = DisplayName;
+                                item.iItem = ListView_GetItemCount(hServicesListCtrl);
+                                item.lParam = 0;
+                                ListView_InsertItem(hServicesListCtrl, &item);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        RegCloseKey(hKey);
+    }
+}