A bit of work towards populating the properties dialog. (untested)
[reactos.git] / reactos / subsys / system / servman / servman.c
index eedc548..386e357 100644 (file)
@@ -17,6 +17,7 @@ HWND hListView;
 HWND hStatus;\r
 HWND hTool;\r
 HMENU hShortcutMenu;\r
+INT SelectedItem;\r
 \r
 \r
 LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r
@@ -100,15 +101,16 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 \r
 /* ======================== Create List View ============================== */\r
 \r
-            hListView = CreateWindow(WC_LISTVIEW,\r
-                                     NULL,\r
-                                     WS_CHILD | WS_VISIBLE | LVS_REPORT | WS_BORDER |\r
-                                     LVS_EDITLABELS | LVS_SORTASCENDING,\r
-                                     0, 0, 0, 0, /* sized via WM_SIZE */\r
-                                     hwnd,\r
-                                     (HMENU) IDC_SERVLIST,\r
-                                     hInstance,\r
-                                     NULL);\r
+            hListView = CreateWindowEx(0,\r
+                                       WC_LISTVIEW,\r
+                                       NULL,\r
+                                       WS_CHILD | WS_VISIBLE | LVS_REPORT | WS_BORDER |\r
+                                       LBS_NOTIFY | LVS_SORTASCENDING | LBS_NOREDRAW,\r
+                                       0, 0, 0, 0, /* sized via WM_SIZE */\r
+                                       hwnd,\r
+                                       (HMENU) IDC_SERVLIST,\r
+                                       hInstance,\r
+                                       NULL);\r
             if (hListView == NULL)\r
                 MessageBox(hwnd, _T("Could not create List View."), _T("Error"), MB_OK | MB_ICONERROR);\r
 \r
@@ -227,14 +229,21 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 \r
            case WM_NOTIFY:\r
         {\r
-            LPNMITEMACTIVATE item;\r
+            NMHDR* nm = (NMHDR*) lParam;\r
 \r
-\r
-            switch (((LPNMHDR) lParam)->code)\r
+            switch (nm->code)\r
             {\r
                    case NM_DBLCLK:\r
-                    item = (LPNMITEMACTIVATE) lParam;\r
-                    PropSheets(hwnd);\r
+                    OpenPropSheet(hwnd);\r
+                           break;\r
+\r
+                           case LVN_ITEMCHANGED:\r
+                           {\r
+                               LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;\r
+\r
+                               SelectedItem = pnmv->iItem;\r
+\r
+                           }\r
                            break;\r
 \r
                 case TTN_GETDISPINFO:\r
@@ -243,7 +252,6 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                     UINT idButton;\r
 \r
                     lpttt = (LPTOOLTIPTEXT) lParam;\r
-                    //lpttt->hinst = hInstance;\r
 \r
                     /* Specify the resource identifier of the descriptive\r
                      * text for the given button. */\r
@@ -300,16 +308,6 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
         }\r
         break;\r
 \r
-           case WM_CLOSE:\r
-            FreeMemory(); /* free the service array */\r
-            DestroyMenu(hShortcutMenu);\r
-                   DestroyWindow(hwnd);\r
-           break;\r
-\r
-           case WM_DESTROY:\r
-                   PostQuitMessage(0);\r
-           break;\r
-\r
         case WM_CONTEXTMENU:\r
             {\r
                 int xPos, yPos;\r
@@ -323,10 +321,11 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
         break;\r
 \r
            case WM_COMMAND:\r
+\r
                    switch(LOWORD(wParam))\r
                    {\r
                 case ID_PROP:\r
-                    PropSheets(hwnd);\r
+                    OpenPropSheet(hwnd);\r
                 break;\r
 \r
                 case ID_REFRESH:\r
@@ -376,6 +375,16 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                    }\r
            break;\r
 \r
+           case WM_CLOSE:\r
+            FreeMemory(); /* free the service array */\r
+            DestroyMenu(hShortcutMenu);\r
+                   DestroyWindow(hwnd);\r
+           break;\r
+\r
+           case WM_DESTROY:\r
+                   PostQuitMessage(0);\r
+           break;\r
+\r
            default:\r
                    return DefWindowProc(hwnd, msg, wParam, lParam);\r
     }\r