Remove all hardcode string to En.rc
Modified: trunk/reactos/subsys/system/cmd/En.rc
Modified: trunk/reactos/subsys/system/cmd/msgbox.c
Modified: trunk/reactos/subsys/system/cmd/path.c
Modified: trunk/reactos/subsys/system/cmd/resource.h
_____
Modified: trunk/reactos/subsys/system/cmd/En.rc
--- trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 11:16:47 UTC
(rev 14867)
+++ trunk/reactos/subsys/system/cmd/En.rc 2005-04-30 11:53:15 UTC
(rev 14868)
@@ -303,9 +303,24 @@
/N Nothing. Don everthing but move files or
direcories.\n\n \
Current limitations:\n \
- You can't move a file or directory from one drive to another.\n"
-
+STRING_MSGBOX_HELP, "display a message box and return user responce\n\n
\
+MSGBOX type ['title'] prompt\n\n \
+type button displayed\n \
+ possible values are: OK, OKCANCEL,\n \
+ YESNO, YESNOCANCEL\n \
+title title of message box\n \
+prompt text displayed by the message box\n\n\n \
+ERRORLEVEL is set according the button pressed:\n\n \
+YES : 10 | NO : 11\n \
+OK : 10 | CANCEL : 12\n"
+STRING_PATH_HELP1, "Displays or sets a search path for executable
files.\n\n \
+PATH [[drive:]path[;...]]\nPATH ;\n\n \
+Type PATH ; to clear all search-path settings and direct the command
shell\n \
+to search only in the current directory.\n \
+Type PATH without parameters to display the current path.\n"
+
STRING_PROMPT_HELP1, "Changes the command prompt.\n\n \
PROMPT [text]\n\n \
text Specifies a new command prompt.\n\n \
@@ -400,6 +415,8 @@
STRING_PARAM_ERROR, "Required parameter missing\n"
+STRING_PATH_ERROR "CMD: Not in environment 'PATH'\n"
+
STRING_ERROR_PARAMETERF_ERROR, "Parameter format not correct - %c\n"
STRING_ERROR_INVALID_SWITCH, "Invalid switch - /%c\n"
STRING_ERROR_TOO_MANY_PARAMETERS, "Too many parameters - %s\n"
_____
Modified: trunk/reactos/subsys/system/cmd/msgbox.c
--- trunk/reactos/subsys/system/cmd/msgbox.c 2005-04-30 11:16:47 UTC
(rev 14867)
+++ trunk/reactos/subsys/system/cmd/msgbox.c 2005-04-30 11:53:15 UTC
(rev 14868)
@@ -5,9 +5,13 @@
*
* 25 Aug 1999
* started - Paolo Pantaleo <paolopan(a)freemail.it>
+ *
+ * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>)
+ * Remove all hardcode string to En.rc
*/
#include "precomp.h"
+#include "resource.h"
#ifdef INCLUDE_CMD_MSGBOX
@@ -28,6 +32,7 @@
//and to find window handle to pass to MessageBox
HWND hWnd;
TCHAR buff[128];
+ WCHAR szMsg[RC_STRING_MAX_SIZE];
//these are MessabeBox() parameters
LPTSTR title, prompt="";
@@ -39,22 +44,8 @@
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
- ConOutPuts(_T(
- "display a message box and return user
responce\n"
- "\n"
- "MSGBOX type [\"title\"] prompt\n"
- "\n"
- "type button displayed\n"
- " possible values are: OK,
OKCANCEL,\n"
- " YESNO, YESNOCANCEL\n"
- "title title of message box\n"
- "prompt text displayed by the
message box\n"
- "\n"
- "\n"
- "ERRORLEVEL is set according the button
pressed:\n"
- "\n"
- "YES : 10 | NO : 11\n"
- "OK : 10 | CANCEL : 12\n"));
+ LoadString( GetModuleHandle(NULL), STRING_MSGBOX_HELP,
(LPTSTR) szMsg,sizeof(szMsg));
+ ConOutPuts((LPTSTR)szMsg);
return 0;
}
_____
Modified: trunk/reactos/subsys/system/cmd/path.c
--- trunk/reactos/subsys/system/cmd/path.c 2005-04-30 11:16:47 UTC
(rev 14867)
+++ trunk/reactos/subsys/system/cmd/path.c 2005-04-30 11:53:15 UTC
(rev 14868)
@@ -21,8 +21,12 @@
*
* 24-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>)
* Fixed Win32 environment handling.
+ *
+ * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>)
+ * Remove all hardcode string to En.rc
*/
#include "precomp.h"
+#include "resource.h"
#ifdef INCLUDE_CMD_PATH
@@ -32,13 +36,13 @@
INT cmd_path (LPTSTR cmd, LPTSTR param)
{
+ WCHAR szMsg[RC_STRING_MAX_SIZE];
+
if (!_tcsncmp (param, _T("/?"), 2))
- {
- ConOutPuts (_T("Displays or sets a search path for
executable files.\n\n"
- "PATH [[drive:]path[;...]]\nPATH
;\n\n"
- "Type PATH ; to clear all search-path
settings and direct the command shell\n"
- "to search only in the current
directory.\n"
- "Type PATH without parameters to
display the current path.\n"));
+ {
+ LoadString( GetModuleHandle(NULL), STRING_PATH_HELP1, (LPTSTR)
szMsg,sizeof(szMsg));
+ ConOutPuts ((LPTSTR)szMsg);
+
return 0;
}
@@ -52,7 +56,8 @@
dwBuffer = GetEnvironmentVariable (_T("PATH"),
pszBuffer, ENV_BUFFER_SIZE);
if (dwBuffer == 0)
{
- ConErrPrintf (_T("CMD: Not in environment
\"PATH\"\n"));
+ LoadString( GetModuleHandle(NULL),
STRING_PATH_ERROR, (LPTSTR) szMsg,sizeof(szMsg));
+ ConErrPrintf ((LPTSTR)szMsg);
return 0;
}
else if (dwBuffer > ENV_BUFFER_SIZE)
_____
Modified: trunk/reactos/subsys/system/cmd/resource.h
--- trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 11:16:47 UTC
(rev 14867)
+++ trunk/reactos/subsys/system/cmd/resource.h 2005-04-30 11:53:15 UTC
(rev 14868)
@@ -64,8 +64,10 @@
#define STRING_MOVE_ERROR1 342
#define STRING_MOVE_ERROR2 343
#define STRING_PARAM_ERROR 344
+#define STRING_PATH_ERROR 345
+
#define STRING_ATTRIB_HELP 600
#define STRING_ALIAS_HELP 601
#define STRING_BEEP_HELP 602
@@ -144,18 +146,22 @@
#define STRING_MOVE_HELP1 662
#define STRING_MOVE_HELP2 663
-#define STRING_PAUSE_HELP1 664
+#define STRING_MSGBOX_HELP 664
-#define STRING_PROMPT_HELP1 665
-#define STRING_PROMPT_HELP2 666
-#define STRING_PROMPT_HELP3 667
+#define STRING_PATH_HELP1 665
-#define STRING_RMDIR_HELP 668
+#define STRING_PAUSE_HELP1 666
-#define STRING_REM_HELP 669
+#define STRING_PROMPT_HELP1 667
+#define STRING_PROMPT_HELP2 668
+#define STRING_PROMPT_HELP3 669
+#define STRING_RMDIR_HELP 670
+#define STRING_REM_HELP 671
+
+