Patch by Michael Fritscher <michael@fritscher.net>
authorThomas Bluemel <thomas@reactsoft.com>
Mon, 21 Nov 2005 13:46:20 +0000 (13:46 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Mon, 21 Nov 2005 13:46:20 +0000 (13:46 +0000)
- support for more/less lines
- support page up/down and pos1/end keys
- added numeration
- added german translation

svn path=/trunk/; revision=19407

rosapps/sysutils/ctm/De.rc [new file with mode: 0644]
rosapps/sysutils/ctm/En.rc
rosapps/sysutils/ctm/Fr.rc
rosapps/sysutils/ctm/ctm.c
rosapps/sysutils/ctm/ctm.rc
rosapps/sysutils/ctm/resource.h

diff --git a/rosapps/sysutils/ctm/De.rc b/rosapps/sysutils/ctm/De.rc
new file mode 100644 (file)
index 0000000..45f8f03
--- /dev/null
@@ -0,0 +1,32 @@
+// German (Germany) resources
+
+LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
+
+STRINGTABLE DISCARDABLE
+BEGIN
+   IDS_APP_TITLE           "Console TaskManager v0.1 von Aleksey Bragin <aleksey@studiocerebral.com>"
+   
+   IDS_COLUMN_NUMBER       "# "
+   IDS_COLUMN_IMAGENAME    "Dateiname                   "
+   IDS_COLUMN_PID          "PID  "
+   IDS_COLUMN_CPU          "CPU"
+   IDS_COLUMN_MEM          "Speicher"
+   IDS_COLUMN_MEM_UNIT         "KB"
+   IDS_COLUMN_PF           "Seitenfehler"
+
+   IDS_IDLE_PROCESS        "Leerlaufprozess"
+   IDS_YES                 "J"
+   IDS_NO                  "N"
+   
+   IDS_MENU                "Tasten: q - beenden, k - Prozess beenden"
+   IDS_MENU_QUIT           "Q"
+   IDS_MENU_KILL_PROCESS   "K"
+   
+   IDS_KILL_PROCESS        "Sind Sie sicher diesen prozess beendenzu wollen (j/n)"
+   IDS_KILL_PROCESS_ERR1   "Fehler beim Beenden des Prozesses aufgetreten..."
+   IDS_KILL_PROCESS_ERR2   "Fehler beim Beenden des Prozesses %d aufgetreten (OpenProcess unmöglich)"
+   
+   IDS_CTM_GENERAL_ERR1    "ctm: Kann die Konsole nicht verwenden."
+   IDS_CTM_GENERAL_ERR2    "ctm: Kann GetConsoleMode() für die Eingabekonsole nicht verwenden."
+   IDS_CTM_GENERAL_ERR3    "ctm: Kann GetConsoleMode() für die Ausgabekonsole nicht verwenden."
+END
index 34c5d00..acbee66 100644 (file)
@@ -1,31 +1,32 @@
-// English (U.S.) resources\r
-\r
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
-\r
-STRINGTABLE DISCARDABLE\r
-BEGIN\r
-   IDS_APP_TITLE           "Console TaskManager v0.1 by Aleksey Bragin <aleksey@studiocerebral.com>"\r
-   \r
-   IDS_COLUMN_IMAGENAME    "Image name                      "\r
-   IDS_COLUMN_PID          "PID  "\r
-   IDS_COLUMN_CPU          "CPU"\r
-   IDS_COLUMN_MEM          "Mem Usage"\r
-   IDS_COLUMN_MEM_UNIT         "Kb"\r
-   IDS_COLUMN_PF           "Page Faults"\r
-\r
-   IDS_IDLE_PROCESS        "System Idle Process"\r
-   IDS_YES                 "Y"\r
-   IDS_NO                  "N"\r
-   \r
-   IDS_MENU                "Press: q - quit, k - kill process"\r
-   IDS_MENU_QUIT           "Q"\r
-   IDS_MENU_KILL_PROCESS   "K"\r
-   \r
-   IDS_KILL_PROCESS        "Are you sure you want to kill this process? (y/n)"\r
-   IDS_KILL_PROCESS_ERR1   "Unable to terminate this process..."\r
-   IDS_KILL_PROCESS_ERR2   "Unable to terminate process %3d (unable to OpenProcess)"\r
-   \r
-   IDS_CTM_GENERAL_ERR1    "ctm: can't use console."\r
-   IDS_CTM_GENERAL_ERR2    "ctm: can't GetConsoleMode() for input console."\r
-   IDS_CTM_GENERAL_ERR3    "ctm: can't GetConsoleMode() for output console."\r
-END\r
+// English (U.S.) resources
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE DISCARDABLE
+BEGIN
+   IDS_APP_TITLE           "Console TaskManager v0.1 by Aleksey Bragin <aleksey@studiocerebral.com>"
+   
+   IDS_COLUMN_NUMBER       "# "
+   IDS_COLUMN_IMAGENAME    "Image name                  "
+   IDS_COLUMN_PID          "PID  "
+   IDS_COLUMN_CPU          "CPU"
+   IDS_COLUMN_MEM          "Mem Usage"
+   IDS_COLUMN_MEM_UNIT         "KB"
+   IDS_COLUMN_PF           "Page Faults"
+
+   IDS_IDLE_PROCESS        "System Idle Process"
+   IDS_YES                 "Y"
+   IDS_NO                  "N"
+   
+   IDS_MENU                "Press: q - quit, k - kill process"
+   IDS_MENU_QUIT           "Q"
+   IDS_MENU_KILL_PROCESS   "K"
+   
+   IDS_KILL_PROCESS        "Are you sure you want to kill this process? (y/n)"
+   IDS_KILL_PROCESS_ERR1   "Unable to terminate this process..."
+   IDS_KILL_PROCESS_ERR2   "Unable to terminate process %d (unable to OpenProcess)"
+   
+   IDS_CTM_GENERAL_ERR1    "ctm: can't use console."
+   IDS_CTM_GENERAL_ERR2    "ctm: can't GetConsoleMode() for input console."
+   IDS_CTM_GENERAL_ERR3    "ctm: can't GetConsoleMode() for output console."
+END
index 8de81a1..0a93793 100644 (file)
@@ -1,31 +1,32 @@
-// French (France) resources\r
-\r
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r
-\r
-STRINGTABLE DISCARDABLE\r
-BEGIN\r
-   IDS_APP_TITLE           "Console TaskManager v0.1 par Aleksey Bragin <aleksey@studiocerebral.com>"\r
-   \r
-   IDS_COLUMN_IMAGENAME    "Processus                   "\r
-   IDS_COLUMN_PID          "PID  "\r
-   IDS_COLUMN_CPU          "CPU"\r
-   IDS_COLUMN_MEM          "Util. mém"\r
-   IDS_COLUMN_MEM_UNIT         "Ko"\r
-   IDS_COLUMN_PF           "Défauts de page"\r
-\r
-   IDS_IDLE_PROCESS        "Processus inactif du système"\r
-   IDS_YES                 "O"\r
-   IDS_NO                  "N"\r
-   \r
-   IDS_MENU                "Menu: Quitter (q), Tuer processus (t)"\r
-   IDS_MENU_QUIT           "Q"\r
-   IDS_MENU_KILL_PROCESS   "T"\r
-   \r
-   IDS_KILL_PROCESS        "Etes-vous sûr de vouloir tuer ce processus (o/n) ?"\r
-   IDS_KILL_PROCESS_ERR1   "Impossible de terminer ce processus..."\r
-   IDS_KILL_PROCESS_ERR2   "Impossible de terminer le processus %3d (erreur lors de OpenProcess)"\r
-   \r
-   IDS_CTM_GENERAL_ERR1    "ctm: impossible d'utiliser la console."\r
-   IDS_CTM_GENERAL_ERR2    "ctm: impossible de récupérer les paramètres de la console d'entrée."\r
-   IDS_CTM_GENERAL_ERR3    "ctm: impossible de récupérer les paramètres de la console de sortie."\r
-END\r
+// French (France) resources
+
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+
+STRINGTABLE DISCARDABLE
+BEGIN
+   IDS_APP_TITLE           "Console TaskManager v0.1 par Aleksey Bragin <aleksey@studiocerebral.com>"
+   
+   IDS_COLUMN_NUMBER       "# "
+   IDS_COLUMN_IMAGENAME    "Image name                "
+   IDS_COLUMN_PID          "PID  "
+   IDS_COLUMN_CPU          "CPU"
+   IDS_COLUMN_MEM          "Util. mém"
+   IDS_COLUMN_MEM_UNIT         "KO"
+   IDS_COLUMN_PF           "Défauts de page"
+
+   IDS_IDLE_PROCESS        "Processus inactif du système"
+   IDS_YES                 "O"
+   IDS_NO                  "N"
+   
+   IDS_MENU                "Menu: Quitter (q), Tuer processus (t)"
+   IDS_MENU_QUIT           "Q"
+   IDS_MENU_KILL_PROCESS   "T"
+   
+   IDS_KILL_PROCESS        "Etes-vous sûr de vouloir tuer ce processus (o/n) ?"
+   IDS_KILL_PROCESS_ERR1   "Impossible de terminer ce processus..."
+   IDS_KILL_PROCESS_ERR2   "Impossible de terminer le processus %d (erreur lors de OpenProcess)"
+   
+   IDS_CTM_GENERAL_ERR1    "ctm: impossible d'utiliser la console."
+   IDS_CTM_GENERAL_ERR2    "ctm: impossible de récupérer les paramètres de la console d'entrée."
+   IDS_CTM_GENERAL_ERR3    "ctm: impossible de récupérer les paramètres de la console de sortie."
+END
index b221817..4d69e56 100644 (file)
@@ -10,7 +10,7 @@
    Localization features added by Hervé Poussineau (hpoussin@reactos.org)
 
    History:
    Localization features added by Hervé Poussineau (hpoussin@reactos.org)
 
    History:
-   24 October 2004 - added localization features
+    24 October 2004 - added localization features
        09 April 2003 - v0.1, fixed bugs, added features, ported to mingw
        20 March 2003 - v0.03, works good under ReactOS, and allows process
                        killing
        09 April 2003 - v0.1, fixed bugs, added features, ported to mingw
        20 March 2003 - v0.03, works good under ReactOS, and allows process
                        killing
@@ -50,7 +50,6 @@
 #include "ctm.h"
 #include "resource.h"
 
 #include "ctm.h"
 #include "resource.h"
 
-#define MAX_PROC 17
 #define TIMES
 
 HANDLE hStdin;
 #define TIMES
 
 HANDLE hStdin;
@@ -73,7 +72,8 @@ TCHAR lpEmpty[80];
 TCHAR KEY_QUIT, KEY_KILL;
 TCHAR KEY_YES, KEY_NO;
 
 TCHAR KEY_QUIT, KEY_KILL;
 TCHAR KEY_YES, KEY_NO;
 
-const int              ProcPerScreen = 17; // 17 processess are displayed on one page
+int                    ProcPerScreen = 17; // 17 processess are displayed on one page
+int                    ScreenLines=25;
 ULONG                  ProcessCountOld = 0;
 ULONG                  ProcessCount = 0;
 
 ULONG                  ProcessCountOld = 0;
 ULONG                  ProcessCount = 0;
 
@@ -92,6 +92,7 @@ int scrolled=0;               // offset from which process start showing
 int first = 0;         // first time in DisplayScreen
 SYSTEM_BASIC_INFORMATION    SystemBasicInfo;
 
 int first = 0;         // first time in DisplayScreen
 SYSTEM_BASIC_INFORMATION    SystemBasicInfo;
 
+CONSOLE_SCREEN_BUFFER_INFO screenBufferInfo;
 #define NEW_CONSOLE
 
 // Functions that are needed by epsapi
 #define NEW_CONSOLE
 
 // Functions that are needed by epsapi
@@ -138,32 +139,36 @@ void RestoreConsole()
 void DisplayScreen()
 {
        COORD pos;
 void DisplayScreen()
 {
        COORD pos;
+       COORD size;
        TCHAR lpStr[80];
        DWORD numChars;
        int lines;
        int idx;
        TCHAR lpStr[80];
        DWORD numChars;
        int lines;
        int idx;
-
+       GetConsoleScreenBufferInfo(hStdout,&screenBufferInfo);
+       size=screenBufferInfo.dwSize;
+       ScreenLines=size.Y;
+       ProcPerScreen = ScreenLines-7;
        if (first == 0)
        {
                // Header
        if (first == 0)
        {
                // Header
-               pos.X = 2; pos.Y = 2;
+               pos.X = 1; pos.Y = 1;
                WriteConsoleOutputCharacter(hStdout, lpTitle, _tcslen(lpTitle), pos, &numChars);
 
                WriteConsoleOutputCharacter(hStdout, lpTitle, _tcslen(lpTitle), pos, &numChars);
 
-               pos.X = 2; pos.Y = 3;
+               pos.X = 1; pos.Y = 2;
                WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos, &numChars);
 
                WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos, &numChars);
 
-               pos.X = 2; pos.Y = 4;
+               pos.X = 1; pos.Y = 3;
                WriteConsoleOutputCharacter(hStdout, lpHeader, _tcslen(lpHeader), pos, &numChars);
 
                WriteConsoleOutputCharacter(hStdout, lpHeader, _tcslen(lpHeader), pos, &numChars);
 
-               pos.X = 2; pos.Y = 5;
+               pos.X = 1; pos.Y = 4;
                WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos, &numChars);
 
                // Footer
                WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos, &numChars);
 
                // Footer
-               pos.X = 2; pos.Y = ProcPerScreen+6;
+               pos.X = 1; pos.Y = ScreenLines-2;
                WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos, &numChars);
 
                // Menu
                WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos, &numChars);
 
                // Menu
-               pos.X = 2; pos.Y = ProcPerScreen+7;
+               pos.X = 1; pos.Y = ScreenLines-1;
                WriteConsoleOutputCharacter(hStdout, lpEmpty, _tcslen(lpEmpty), pos, &numChars);
                WriteConsoleOutputCharacter(hStdout, lpMenu, _tcslen(lpMenu), pos, &numChars);
 
                WriteConsoleOutputCharacter(hStdout, lpEmpty, _tcslen(lpEmpty), pos, &numChars);
                WriteConsoleOutputCharacter(hStdout, lpMenu, _tcslen(lpMenu), pos, &numChars);
 
@@ -172,11 +177,12 @@ void DisplayScreen()
 
        // Processess
        lines = ProcessCount;
 
        // Processess
        lines = ProcessCount;
-       if (lines > MAX_PROC)
-               lines = MAX_PROC;
-       for (idx=0; idx<MAX_PROC; idx++)
+       if (lines > ProcPerScreen)
+               lines = ProcPerScreen;
+       for (idx=0; idx<ProcPerScreen; idx++)
        {
                int len, i;
        {
                int len, i;
+               TCHAR lpNumber[5];
                TCHAR lpPid[8];
                TCHAR lpCpu[6];
                TCHAR lpMemUsg[12];
                TCHAR lpPid[8];
                TCHAR lpCpu[6];
                TCHAR lpMemUsg[12];
@@ -189,6 +195,11 @@ void DisplayScreen()
                // data
                if (idx < lines && scrolled + idx < ProcessCount)
                {
                // data
                if (idx < lines && scrolled + idx < ProcessCount)
                {
+
+                       // number
+                       _stprintf(lpNumber, _T("%3d"), idx+scrolled);
+                       _tcsncpy(&lpStr[2], lpNumber, 3);
+
                        // image name
 #ifdef _UNICODE
                   len = wcslen(pPerfData[scrolled+idx].ImageName);
                        // image name
 #ifdef _UNICODE
                   len = wcslen(pPerfData[scrolled+idx].ImageName);
@@ -197,45 +208,45 @@ void DisplayScreen()
                                       imgName, MAX_PATH, NULL, NULL);
                   len = strlen(imgName);
 #endif
                                       imgName, MAX_PATH, NULL, NULL);
                   len = strlen(imgName);
 #endif
-                       if (len > columnRightPositions[0])
+                       if (len > columnRightPositions[1])
                        {
                        {
-                               len = columnRightPositions[0];
+                               len = columnRightPositions[1];
                        }
 #ifdef _UNICODE
                        }
 #ifdef _UNICODE
-                  wcsncpy(&lpStr[2], pPerfData[scrolled+idx].ImageName, len);
+                  wcsncpy(&lpStr[columnRightPositions[0]+3], pPerfData[scrolled+idx].ImageName, len);
 #else
 #else
-                  strncpy(&lpStr[2], imgName, len);
+                  strncpy(&lpStr[columnRightPositions[0]+3], imgName, len);
 #endif
 
                        // PID
 #endif
 
                        // PID
-                  _stprintf(lpPid, _T("%6ld"), pPerfData[scrolled+idx].ProcessId);
-                       _tcsncpy(&lpStr[columnRightPositions[1] - 6], lpPid, 6);
+                       _stprintf(lpPid, _T("%6ld"), pPerfData[scrolled+idx].ProcessId);
+                       _tcsncpy(&lpStr[columnRightPositions[2] - 6], lpPid, 6);
 
 #ifdef TIMES
                        // CPU
                        _stprintf(lpCpu, _T("%3d%%"), pPerfData[scrolled+idx].CPUUsage);
 
 #ifdef TIMES
                        // CPU
                        _stprintf(lpCpu, _T("%3d%%"), pPerfData[scrolled+idx].CPUUsage);
-                       _tcsncpy(&lpStr[columnRightPositions[2] - 4], lpCpu, 4);
+                       _tcsncpy(&lpStr[columnRightPositions[3] - 4], lpCpu, 4);
 #endif
 
                        // Mem usage
                         _stprintf(lpMemUsg, _T("%6ld %s"), pPerfData[scrolled+idx].WorkingSetSizeBytes / 1024, lpMemUnit);
 #endif
 
                        // Mem usage
                         _stprintf(lpMemUsg, _T("%6ld %s"), pPerfData[scrolled+idx].WorkingSetSizeBytes / 1024, lpMemUnit);
-                        _tcsncpy(&lpStr[columnRightPositions[3] - 9], lpMemUsg, 9);
+                        _tcsncpy(&lpStr[columnRightPositions[4] - 9], lpMemUsg, 9);
 
                        // Page Fault
                        _stprintf(lpPageFaults, _T("%12ld"), pPerfData[scrolled+idx].PageFaultCount);
 
                        // Page Fault
                        _stprintf(lpPageFaults, _T("%12ld"), pPerfData[scrolled+idx].PageFaultCount);
-                       _tcsncpy(&lpStr[columnRightPositions[4] - 12], lpPageFaults, 12);
+                       _tcsncpy(&lpStr[columnRightPositions[5] - 12], lpPageFaults, 12);
                }
 
                // columns
                lpStr[0] = _T(' ');
                lpStr[1] = _T('|');
                }
 
                // columns
                lpStr[0] = _T(' ');
                lpStr[1] = _T('|');
-               for (i = 0; i < 5; i++)
+               for (i = 0; i < 6; i++)
                        lpStr[columnRightPositions[i] + 1] = _T('|');
                        lpStr[columnRightPositions[i] + 1] = _T('|');
-                pos.X = 1; pos.Y = 6+idx;
-               WriteConsoleOutputCharacter(hStdout, lpStr, 74, pos, &numChars);
+                pos.X = 0; pos.Y = 5+idx;
+               WriteConsoleOutputCharacter(hStdout, lpStr, 80, pos, &numChars);
 
                // Attributes now...
 
                // Attributes now...
-               pos.X = 3; pos.Y = 6+idx;
+               pos.X = columnRightPositions[0] + 1; pos.Y = 5+idx;
                if (selection == idx)
                {
                        wColor = BACKGROUND_GREEN |
                if (selection == idx)
                {
                        wColor = BACKGROUND_GREEN |
@@ -254,7 +265,7 @@ void DisplayScreen()
                FillConsoleOutputAttribute(
                        hStdout,          // screen buffer handle
                        wColor,           // color to fill with
                FillConsoleOutputAttribute(
                        hStdout,          // screen buffer handle
                        wColor,           // color to fill with
-                       columnRightPositions[0] - 1,    // number of cells to fill
+                       columnRightPositions[1] - 4,    // number of cells to fill
                        pos,            // first cell to write to
                        &numChars);       // actual number written
        }
                        pos,            // first cell to write to
                        &numChars);       // actual number written
        }
@@ -279,7 +290,7 @@ int ProcessKeys(int numEvents)
                COORD pos;
                TCHAR lpStr[100];
 
                COORD pos;
                TCHAR lpStr[100];
 
-               pos.X = 2; pos.Y = 24;
+               pos.X = 1; pos.Y =ScreenLines-1;
                if (LoadString(hInst, IDS_KILL_PROCESS, lpStr, 100))
                        WriteConsoleOutputCharacter(hStdout, lpStr, _tcslen(lpStr), pos, &numChars);
 
                if (LoadString(hInst, IDS_KILL_PROCESS, lpStr, 100))
                        WriteConsoleOutputCharacter(hStdout, lpStr, _tcslen(lpStr), pos, &numChars);
 
@@ -331,12 +342,53 @@ int ProcessKeys(int numEvents)
        }
        else if (key == VK_DOWN)
        {
        }
        else if (key == VK_DOWN)
        {
-               if ((selection < MAX_PROC-1) && (selection < ProcessCount-1))
+               if ((selection < ProcPerScreen-1) && (selection < ProcessCount-1))
                        selection++;
                        selection++;
-               else if ((selection == MAX_PROC-1) && (selection+scrolled < ProcessCount-1))
+               else if ((selection == ProcPerScreen-1) && (selection+scrolled < ProcessCount-1))
                        scrolled++;
        }
                        scrolled++;
        }
+       else if (key == VK_PRIOR)
+       {
+               if (scrolled>ProcPerScreen-1)
+                       scrolled-=ProcPerScreen-1;
+               else
+               {
+                       scrolled=0; //First
+                       selection=0;
+               }
+               //selection=0;
+       }
+       else if (key == VK_NEXT)
+       {
+               scrolled+=ProcPerScreen-1;
+               if (scrolled>ProcessCount-ProcPerScreen)
+               {
+                       scrolled=ProcessCount-ProcPerScreen; //End
+                       selection=ProcPerScreen-1;
+               }
 
 
+               //selection=ProcPerScreen-1;
+               if (ProcessCount<=ProcPerScreen) //If there are less process than fits on the screen
+               {
+                       scrolled=0;
+                       selection=(ProcessCount%ProcPerScreen)-1;
+               }
+       }
+       else if  (key == VK_HOME)
+       {
+               selection=0;
+               scrolled=0;
+       }
+       else if  (key == VK_END)
+       {
+               selection=ProcPerScreen-1;
+               scrolled=ProcessCount-ProcPerScreen;
+               if (ProcessCount<=ProcPerScreen) //If there are less process than fits on the screen
+               {
+                       scrolled=0;
+                       selection=(ProcessCount%ProcPerScreen)-1;
+               }
+       }
        return FALSE;
 }
 
        return FALSE;
 }
 
@@ -561,43 +613,49 @@ int main(int argc, char **argv)
 
        /* Initialize global variables */
        hInst = 0 /* FIXME: which value? [used with LoadString(hInst, ..., ..., ...)] */;
 
        /* Initialize global variables */
        hInst = 0 /* FIXME: which value? [used with LoadString(hInst, ..., ..., ...)] */;
-       if (LoadString(hInst, IDS_COLUMN_IMAGENAME, lpStr, 80))
+
+       if (LoadString(hInst, IDS_COLUMN_NUMBER, lpStr, 80))
        {
        {
-               columnRightPositions[0] = _tcslen(lpStr);
+               columnRightPositions[0] = _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[2], lpStr, _tcslen(lpStr));
        }
                _tcsncpy(&lpHeader[2], lpStr, _tcslen(lpStr));
        }
-       if (LoadString(hInst, IDS_COLUMN_PID, lpStr, 80))
+       if (LoadString(hInst, IDS_COLUMN_IMAGENAME, lpStr, 80))
        {
                columnRightPositions[1] = columnRightPositions[0] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[0] + 2], lpStr, _tcslen(lpStr));
        }
        {
                columnRightPositions[1] = columnRightPositions[0] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[0] + 2], lpStr, _tcslen(lpStr));
        }
-       if (LoadString(hInst, IDS_COLUMN_CPU, lpStr, 80))
+       if (LoadString(hInst, IDS_COLUMN_PID, lpStr, 80))
        {
                columnRightPositions[2] = columnRightPositions[1] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[1] + 2], lpStr, _tcslen(lpStr));
        }
        {
                columnRightPositions[2] = columnRightPositions[1] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[1] + 2], lpStr, _tcslen(lpStr));
        }
-       if (LoadString(hInst, IDS_COLUMN_MEM, lpStr, 80))
+       if (LoadString(hInst, IDS_COLUMN_CPU, lpStr, 80))
        {
                columnRightPositions[3] = columnRightPositions[2] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[2] + 2], lpStr, _tcslen(lpStr));
        }
        {
                columnRightPositions[3] = columnRightPositions[2] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[2] + 2], lpStr, _tcslen(lpStr));
        }
-       if (LoadString(hInst, IDS_COLUMN_PF, lpStr, 80))
+       if (LoadString(hInst, IDS_COLUMN_MEM, lpStr, 80))
        {
                columnRightPositions[4] = columnRightPositions[3] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[3] + 2], lpStr, _tcslen(lpStr));
        }
        {
                columnRightPositions[4] = columnRightPositions[3] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[3] + 2], lpStr, _tcslen(lpStr));
        }
+       if (LoadString(hInst, IDS_COLUMN_PF, lpStr, 80))
+       {
+               columnRightPositions[5] = columnRightPositions[4] + _tcslen(lpStr) + 3;
+               _tcsncpy(&lpHeader[columnRightPositions[4] + 2], lpStr, _tcslen(lpStr));
+       }
 
 
-       for (i = 0; i < columnRightPositions[4]; i++)
+       for (i = 0; i < columnRightPositions[5]; i++)
                lpSeparator[i] = _T('-');
        lpHeader[0] = _T('|');
        lpSeparator[0] = _T('+');
                lpSeparator[i] = _T('-');
        lpHeader[0] = _T('|');
        lpSeparator[0] = _T('+');
-       for (i = 0; i < 5; i++)
+       for (i = 0; i < 6; i++)
        {
                lpHeader[columnRightPositions[i]] = _T('|');
                lpSeparator[columnRightPositions[i]] = _T('+');
        }
        {
                lpHeader[columnRightPositions[i]] = _T('|');
                lpSeparator[columnRightPositions[i]] = _T('+');
        }
-       lpSeparator[columnRightPositions[4] + 1] = _T('\0');
-       lpHeader[columnRightPositions[4] + 1] = _T('\0');
+       lpSeparator[columnRightPositions[5] + 1] = _T('\0');
+       lpHeader[columnRightPositions[5] + 1] = _T('\0');
 
 
        if (!LoadString(hInst, IDS_APP_TITLE, lpTitle, 80))
 
 
        if (!LoadString(hInst, IDS_APP_TITLE, lpTitle, 80))
index 8f9b280..bbd43a3 100644 (file)
@@ -11,3 +11,4 @@
 
 #include "En.rc"
 #include "Fr.rc"
 
 #include "En.rc"
 #include "Fr.rc"
+#include "De.rc"
index 8a8406b..aa47303 100644 (file)
 
 #define IDS_APP_TITLE            0
 
 
 #define IDS_APP_TITLE            0
 
-#define IDS_COLUMN_IMAGENAME     10
-#define IDS_COLUMN_PID           11
-#define IDS_COLUMN_CPU           12
-#define IDS_COLUMN_MEM           13
-#define IDS_COLUMN_MEM_UNIT            14
-#define IDS_COLUMN_PF            15
+#define IDS_COLUMN_NUMBER        10
+#define IDS_COLUMN_IMAGENAME     11
+#define IDS_COLUMN_PID           12
+#define IDS_COLUMN_CPU           13
+#define IDS_COLUMN_MEM           14
+#define IDS_COLUMN_MEM_UNIT      15
+#define IDS_COLUMN_PF            16
 
 #define IDS_IDLE_PROCESS         100
 #define IDS_YES                  101
 
 #define IDS_IDLE_PROCESS         100
 #define IDS_YES                  101