- fix toolbar position, deleted a line accidentally.
authorGed Murphy <gedmurphy@reactos.org>
Sun, 8 Jan 2006 18:50:54 +0000 (18:50 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Sun, 8 Jan 2006 18:50:54 +0000 (18:50 +0000)
- Fix the formatting a bit while we're at it
- Comment out German language whilst it's still in development

svn path=/trunk/; revision=20717

reactos/subsys/system/servman/about.c
reactos/subsys/system/servman/servman.c
reactos/subsys/system/servman/servman.rc

index 3de098c..d946dfa 100644 (file)
@@ -7,6 +7,8 @@
  *               \r
  */\r
 \r
  *               \r
  */\r
 \r
+//ShellAbout(hwnd, _T("test"), _T("test2"), MAKEINTRESOURCE(IDI_SM_ICON));\r
+\r
 #include "servman.h"\r
 \r
 extern HINSTANCE hInstance;\r
 #include "servman.h"\r
 \r
 extern HINSTANCE hInstance;\r
index 314284a..4b84889 100644 (file)
@@ -20,28 +20,28 @@ HWND hTool;
 \r
 LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r
 {\r
 \r
 LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r
 {\r
-       switch(msg)\r
-       {\r
-               case WM_CREATE:\r
-               {\r
-                       //HFONT hfDefault;\r
-\r
-                       HWND hTool;\r
-                       TBADDBITMAP tbab;\r
+    switch(msg)\r
+    {\r
+        case WM_CREATE:\r
+        {\r
+             //HFONT hfDefault;\r
+\r
+            HWND hTool;\r
+            TBADDBITMAP tbab;\r
             INT iImageOffset;\r
             INT iImageOffset;\r
-                       INT statwidths[] = {110, -1};\r
-                       TCHAR szTemp[256];\r
+            INT statwidths[] = {110, -1};\r
+            TCHAR szTemp[256];\r
             RECT rcClient;\r
             LVCOLUMN lvc = { 0 };\r
 \r
             /* Toolbar buttons */\r
             RECT rcClient;\r
             LVCOLUMN lvc = { 0 };\r
 \r
             /* Toolbar buttons */\r
-               TBBUTTON tbb [NUM_BUTTONS] = \r
+            TBBUTTON tbb [NUM_BUTTONS] = \r
             { // iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString\r
                 {STD_PROPERTIES, ID_PROP,    TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},    /* properties */\r
                 {STD_FILENEW,    ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},    /*  */\r
                 {STD_FILENEW,    ID_EXPORT,  TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},    /*  */\r
 \r
             { // iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString\r
                 {STD_PROPERTIES, ID_PROP,    TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},    /* properties */\r
                 {STD_FILENEW,    ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},    /*  */\r
                 {STD_FILENEW,    ID_EXPORT,  TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},    /*  */\r
 \r
-                       /* Note: First item for a seperator is its width in pixels */\r
+                /* Note: First item for a seperator is its width in pixels */\r
                 {5, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},                             /* separator */\r
 \r
                 {TBICON_START,   ID_START,   TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 },   /* start */ \r
                 {5, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},                             /* separator */\r
 \r
                 {TBICON_START,   ID_START,   TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 },   /* start */ \r
@@ -53,7 +53,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 /* ======================== Create Toolbar ============================== */\r
 \r
             /* Create Toolbar */\r
 /* ======================== Create Toolbar ============================== */\r
 \r
             /* Create Toolbar */\r
-                       hTool = CreateWindowEx(0,\r
+            hTool = CreateWindowEx(0,\r
                                    TOOLBARCLASSNAME,\r
                                    NULL,\r
                                    WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS,\r
                                    TOOLBARCLASSNAME,\r
                                    NULL,\r
                                    WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS,\r
@@ -62,35 +62,35 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                                    (HMENU)IDC_TOOLBAR,\r
                                    hInstance,\r
                                    NULL);\r
                                    (HMENU)IDC_TOOLBAR,\r
                                    hInstance,\r
                                    NULL);\r
-                       if(hTool == NULL)\r
-                               MessageBox(hwnd, _T("Could not create tool bar."), _T("Error"), MB_OK | MB_ICONERROR);\r
+            if(hTool == NULL)\r
+                MessageBox(hwnd, _T("Could not create tool bar."), _T("Error"), MB_OK | MB_ICONERROR);\r
 \r
             /* Send the TB_BUTTONSTRUCTSIZE message, which is required for backward compatibility */\r
 \r
             /* Send the TB_BUTTONSTRUCTSIZE message, which is required for backward compatibility */\r
-               SendMessage(hTool, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);\r
+            SendMessage(hTool, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);\r
 \r
 \r
-               /* Add standard image list */\r
-               tbab.hInst = HINST_COMMCTRL;\r
-               tbab.nID = IDB_STD_SMALL_COLOR;\r
-               SendMessage(hTool, TB_ADDBITMAP, 0, (LPARAM) &tbab);\r
+            /* Add standard image list */\r
+            tbab.hInst = HINST_COMMCTRL;\r
+            tbab.nID = IDB_STD_SMALL_COLOR;\r
+            SendMessage(hTool, TB_ADDBITMAP, 0, (LPARAM) &tbab);\r
 \r
 \r
-               /* Add custom images */\r
-               tbab.hInst = hInstance;\r
-               tbab.nID = IDB_BUTTONS;\r
-               iImageOffset = (INT)SendMessage(hTool, TB_ADDBITMAP, 4, (LPARAM)&tbab);\r
-               tbb[4].iBitmap += iImageOffset; /* start */\r
-               tbb[5].iBitmap += iImageOffset; /* stop */\r
-               tbb[6].iBitmap += iImageOffset; /* pause */  \r
-               tbb[7].iBitmap += iImageOffset; /* restart */\r
+            /* Add custom images */\r
+            tbab.hInst = hInstance;\r
+            tbab.nID = IDB_BUTTONS;\r
+            iImageOffset = (INT)SendMessage(hTool, TB_ADDBITMAP, 4, (LPARAM)&tbab);\r
+            tbb[4].iBitmap += iImageOffset; /* start */\r
+            tbb[5].iBitmap += iImageOffset; /* stop */\r
+            tbb[6].iBitmap += iImageOffset; /* pause */  \r
+            tbb[7].iBitmap += iImageOffset; /* restart */\r
 \r
 \r
-               /* Add buttons to toolbar */\r
-               SendMessage(hTool, TB_ADDBUTTONS, NUM_BUTTONS, (LPARAM) &tbb);\r
+            /* Add buttons to toolbar */\r
+            SendMessage(hTool, TB_ADDBUTTONS, NUM_BUTTONS, (LPARAM) &tbb);\r
 \r
 \r
-               /* Send a WM_SIZE message to layout controls */\r
-               GetClientRect(hwnd, &rcClient);\r
-               SendMessage(hwnd, WM_SIZE, SIZE_RESTORED, MAKELONG(rcClient.right, rcClient.bottom));\r
+            /* Send a WM_SIZE message to layout controls */\r
+            GetClientRect(hwnd, &rcClient);\r
+            SendMessage(hwnd, WM_SIZE, SIZE_RESTORED, MAKELONG(rcClient.right, rcClient.bottom));\r
 \r
 \r
-               /* Show toolbar */\r
-               ShowWindow(hTool, SW_SHOWNORMAL);\r
+            /* Show toolbar */\r
+            ShowWindow(hTool, SW_SHOWNORMAL);\r
 \r
 \r
 \r
 \r
 \r
 \r
@@ -151,7 +151,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 \r
 /* ======================== Create Status Bar ============================== */\r
 \r
 \r
 /* ======================== Create Status Bar ============================== */\r
 \r
-                       hStatus = CreateWindowEx(0,\r
+                   hStatus = CreateWindowEx(0,\r
                                      STATUSCLASSNAME,\r
                                      NULL,\r
                                      WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP,\r
                                      STATUSCLASSNAME,\r
                                      NULL,\r
                                      WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP,\r
@@ -161,63 +161,64 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                                      hInstance,\r
                                      NULL);\r
             if(hStatus == NULL)\r
                                      hInstance,\r
                                      NULL);\r
             if(hStatus == NULL)\r
-                               MessageBox(hwnd, _T("Could not create status bar."),\r
+                           MessageBox(hwnd, _T("Could not create status bar."),\r
                            _T("Error!"), MB_OK | MB_ICONERROR);\r
 \r
                            _T("Error!"), MB_OK | MB_ICONERROR);\r
 \r
-                       SendMessage(hStatus, SB_SETPARTS, sizeof(statwidths)/sizeof(int), (LPARAM)statwidths);\r
+                   SendMessage(hStatus, SB_SETPARTS, sizeof(statwidths)/sizeof(int), (LPARAM)statwidths);\r
 \r
 \r
-                       /* populate the list view with all services */\r
-                       if (! RefreshServiceList() )\r
+                   /* populate the list view with all services */\r
+                   if (! RefreshServiceList() )\r
                 GetError();\r
 \r
                 GetError();\r
 \r
-               }\r
-               break;\r
-               case WM_SIZE:\r
-               {\r
-                       RECT rcTool;\r
-                       int iToolHeight;\r
+           }\r
+           break;\r
+           case WM_SIZE:\r
+           {\r
+                   RECT rcTool;\r
+                   int iToolHeight;\r
 \r
 \r
-                       RECT rcStatus;\r
-                       int iStatusHeight;\r
+                   RECT rcStatus;\r
+                   int iStatusHeight;\r
 \r
 \r
-                       int lvHeight;\r
-                       RECT rcClient;\r
+                   int lvHeight;\r
+                   RECT rcClient;\r
 \r
 \r
-                       /* Size toolbar and get height */\r
-                       SendMessage(hTool, TB_AUTOSIZE, 0, 0);\r
+                   /* Size toolbar and get height */\r
+            hTool = GetDlgItem(hwnd, IDC_TOOLBAR);\r
+                   SendMessage(hTool, TB_AUTOSIZE, 0, 0);\r
 \r
 \r
-                       GetWindowRect(hTool, &rcTool);\r
-                       iToolHeight = rcTool.bottom - rcTool.top;\r
+                   GetWindowRect(hTool, &rcTool);\r
+                   iToolHeight = rcTool.bottom - rcTool.top;\r
 \r
 \r
-                       /* Size status bar and get height */\r
-                       hStatus = GetDlgItem(hwnd, IDC_STATUSBAR);\r
-                       SendMessage(hStatus, WM_SIZE, 0, 0);\r
+                   /* Size status bar and get height */\r
+                   hStatus = GetDlgItem(hwnd, IDC_STATUSBAR);\r
+                   SendMessage(hStatus, WM_SIZE, 0, 0);\r
 \r
 \r
-                       GetWindowRect(hStatus, &rcStatus);\r
-                       iStatusHeight = rcStatus.bottom - rcStatus.top;\r
+                   GetWindowRect(hStatus, &rcStatus);\r
+                   iStatusHeight = rcStatus.bottom - rcStatus.top;\r
 \r
 \r
-                       /* Calculate remaining height and size list view */\r
-                       GetClientRect(hwnd, &rcClient);\r
+                   /* Calculate remaining height and size list view */\r
+                   GetClientRect(hwnd, &rcClient);\r
 \r
 \r
-                       lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;\r
+                   lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;\r
 \r
 \r
-                       hListView = GetDlgItem(hwnd, IDC_SERVLIST);\r
-                       SetWindowPos(hListView, NULL, 0, iToolHeight, rcClient.right, lvHeight, SWP_NOZORDER);\r
-               }\r
-               break;\r
+                   hListView = GetDlgItem(hwnd, IDC_SERVLIST);\r
+                   SetWindowPos(hListView, NULL, 0, iToolHeight, rcClient.right, lvHeight, SWP_NOZORDER);\r
+           }\r
+           break;\r
 \r
 \r
-               case WM_NOTIFY:\r
+           case WM_NOTIFY:\r
         {\r
             LPNMITEMACTIVATE item;\r
 \r
             switch (((LPNMHDR) lParam)->code)\r
             {\r
 \r
         {\r
             LPNMITEMACTIVATE item;\r
 \r
             switch (((LPNMHDR) lParam)->code)\r
             {\r
 \r
-                       case NM_DBLCLK:\r
-                               item = (LPNMITEMACTIVATE) lParam;\r
-                               PropSheets(hwnd);\r
+                   case NM_DBLCLK:\r
+                           item = (LPNMITEMACTIVATE) lParam;\r
+                           PropSheets(hwnd);\r
 \r
 \r
-                               break;\r
+                           break;\r
             \r
                 case TTN_GETDISPINFO:\r
                 {\r
             \r
                 case TTN_GETDISPINFO:\r
                 {\r
@@ -270,25 +271,25 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
         }\r
         break;\r
 \r
         }\r
         break;\r
 \r
-               case WM_CLOSE:\r
+           case WM_CLOSE:\r
             /* free the service array */\r
             FreeMemory();\r
             /* free the service array */\r
             FreeMemory();\r
-                       DestroyWindow(hwnd);\r
-               break;\r
+                   DestroyWindow(hwnd);\r
+           break;\r
 \r
 \r
-               case WM_DESTROY:\r
-                       PostQuitMessage(0);\r
-               break;\r
+           case WM_DESTROY:\r
+                   PostQuitMessage(0);\r
+           break;\r
 \r
 \r
-               case WM_COMMAND:\r
-                       switch(LOWORD(wParam))\r
-                       {\r
-                               case ID_FILE_EXIT:\r
-                                       PostMessage(hwnd, WM_CLOSE, 0, 0);\r
-                               break;\r
+           case WM_COMMAND:\r
+                   switch(LOWORD(wParam))\r
+                   {\r
+                           case ID_FILE_EXIT:\r
+                                   PostMessage(hwnd, WM_CLOSE, 0, 0);\r
+                           break;\r
 \r
 \r
-                               case ID_START:\r
-                               break;\r
+                           case ID_START:\r
+                           break;\r
 \r
                 case ID_STOP:\r
                 break;\r
 \r
                 case ID_STOP:\r
                 break;\r
@@ -322,66 +323,66 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                 case ID_EXPORT:\r
                 break;\r
 \r
                 case ID_EXPORT:\r
                 break;\r
 \r
-                       }\r
-               break;\r
+                   }\r
+           break;\r
 \r
 \r
-               default:\r
-                       return DefWindowProc(hwnd, msg, wParam, lParam);\r
-       }\r
-       return 0;\r
+           default:\r
+                   return DefWindowProc(hwnd, msg, wParam, lParam);\r
+    }\r
+    return 0;\r
 }\r
 \r
 \r
 //#pragma warning(disable : 4100)\r
 int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance,\r
 }\r
 \r
 \r
 //#pragma warning(disable : 4100)\r
 int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance,\r
-       LPSTR lpCmdLine, int nCmdShow)\r
+    LPSTR lpCmdLine, int nCmdShow)\r
 {\r
 {\r
-       WNDCLASSEX wc;\r
-       MSG Msg;\r
-       BOOL bRet;\r
-\r
-       hInstance = hThisInstance;\r
-\r
-       InitCommonControls();\r
-\r
-       wc.cbSize                = sizeof(WNDCLASSEX);\r
-       wc.style                 = 0;\r
-       wc.lpfnWndProc   = WndProc;\r
-       wc.cbClsExtra    = 0;\r
-       wc.cbWndExtra    = 0;\r
-       wc.hInstance     = hInstance;\r
-       wc.hIcon                 = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON));\r
-       wc.hCursor               = LoadCursor(NULL, IDC_ARROW);\r
-       wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);\r
-       wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MAINMENU);\r
-       wc.lpszClassName = ClassName;\r
-       wc.hIconSm               = (HICON)LoadImage(hInstance,\r
+    WNDCLASSEX wc;\r
+    MSG Msg;\r
+    BOOL bRet;\r
+\r
+    hInstance = hThisInstance;\r
+\r
+    InitCommonControls();\r
+\r
+    wc.cbSize           = sizeof(WNDCLASSEX);\r
+    wc.style            = 0;\r
+    wc.lpfnWndProc      = WndProc;\r
+    wc.cbClsExtra       = 0;\r
+    wc.cbWndExtra       = 0;\r
+    wc.hInstance        = hInstance;\r
+    wc.hIcon            = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON));\r
+    wc.hCursor          = LoadCursor(NULL, IDC_ARROW);\r
+    wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);\r
+    wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MAINMENU);\r
+    wc.lpszClassName = ClassName;\r
+    wc.hIconSm          = (HICON)LoadImage(hInstance,\r
                         MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0);\r
 \r
                         MAKEINTRESOURCE(IDI_SM_ICON), IMAGE_ICON, 16, 16, 0);\r
 \r
-       if(!RegisterClassEx(&wc))\r
-       {\r
-               MessageBox(NULL, _T("Window Registration Failed!"), _T("Error!"),\r
-                       MB_ICONEXCLAMATION | MB_OK);\r
-               return 0;\r
-       }\r
-\r
-       hMainWnd = CreateWindowEx(\r
-               0,\r
-               ClassName,\r
-               _T("ReactOS Service Manager"),\r
-               WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,\r
-               CW_USEDEFAULT, CW_USEDEFAULT, 700, 500,\r
-               NULL, NULL, hInstance, NULL);\r
-\r
-       if(hMainWnd == NULL)\r
-       {\r
-               MessageBox(NULL, _T("Window Creation Failed!"), _T("Error!"),\r
-                       MB_ICONEXCLAMATION | MB_OK);\r
-               return 0;\r
-       }\r
-\r
-       ShowWindow(hMainWnd, nCmdShow);\r
-       UpdateWindow(hMainWnd);\r
+    if(!RegisterClassEx(&wc))\r
+    {\r
+           MessageBox(NULL, _T("Window Registration Failed!"), _T("Error!"),\r
+                   MB_ICONEXCLAMATION | MB_OK);\r
+           return 0;\r
+    }\r
+\r
+    hMainWnd = CreateWindowEx(\r
+           0,\r
+           ClassName,\r
+           _T("ReactOS Service Manager"),\r
+           WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,\r
+           CW_USEDEFAULT, CW_USEDEFAULT, 700, 500,\r
+           NULL, NULL, hInstance, NULL);\r
+\r
+    if(hMainWnd == NULL)\r
+    {\r
+           MessageBox(NULL, _T("Window Creation Failed!"), _T("Error!"),\r
+                   MB_ICONEXCLAMATION | MB_OK);\r
+           return 0;\r
+    }\r
+\r
+    ShowWindow(hMainWnd, nCmdShow);\r
+    UpdateWindow(hMainWnd);\r
 \r
     while( (bRet = GetMessage( &Msg, NULL, 0, 0 )) != 0)\r
     {\r
 \r
     while( (bRet = GetMessage( &Msg, NULL, 0, 0 )) != 0)\r
     {\r
@@ -395,7 +396,7 @@ int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
             DispatchMessage(&Msg);\r
         }\r
     }\r
             DispatchMessage(&Msg);\r
         }\r
     }\r
-       return Msg.wParam;\r
+    return Msg.wParam;\r
 }\r
 \r
 \r
 }\r
 \r
 \r
index 0b0e22c..b771ab9 100644 (file)
@@ -13,5 +13,5 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 IDI_SM_ICON ICON "res/system.ico"\r
 \r
 #include "En.rc"\r
 IDI_SM_ICON ICON "res/system.ico"\r
 \r
 #include "En.rc"\r
-#include "De.rc"\r
+//#include "De.rc" /* I don't want to have to keep altering 2 files whilst developing */\r
 \r
 \r