Remove last hardcode string I have check the soure 3more time after I
found some more hardcode string
at last every hardcode string are gone in cmd and place in En.rc
new strings in en.rc
STRING_COPY_FILE , STRING_DELETE_WIPE, STRING_FOR_ERROR,
STRING_SCREEN_COL, STRING_SCREEN_ROW, STRING_TIMER_TIME
remove some unlsess value in chcp it is no longer in use thanks we are
chaching the codepage hole time.
Modified: trunk/reactos/subsys/system/cmd/En.rc
Modified: trunk/reactos/subsys/system/cmd/chcp.c
Modified: trunk/reactos/subsys/system/cmd/cmd.c
Modified: trunk/reactos/subsys/system/cmd/cmd.h
Modified: trunk/reactos/subsys/system/cmd/copy.c
Modified: trunk/reactos/subsys/system/cmd/del.c
Modified: trunk/reactos/subsys/system/cmd/dir.c
Modified: trunk/reactos/subsys/system/cmd/for.c
Modified: trunk/reactos/subsys/system/cmd/ren.c
Modified: trunk/reactos/subsys/system/cmd/resource.h
Modified: trunk/reactos/subsys/system/cmd/screen.c
Modified: trunk/reactos/subsys/system/cmd/timer.c
Modified: trunk/reactos/subsys/system/cmd/ver.c
Modified: trunk/reactos/subsys/system/cmd/verify.c
Modified: trunk/reactos/subsys/system/cmd/window.c
_____
Modified: trunk/reactos/subsys/system/cmd/En.rc
--- trunk/reactos/subsys/system/cmd/En.rc 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/En.rc 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -564,5 +564,11 @@
STRING_CMD_INVALIDDRIVE, "ERROR: invalid drive"
STRING_CMD_SHELLINFO, "\nReactOS Command Line Interpreter"
-STRING_VERSION_RUNVER " running on %s"
+STRING_VERSION_RUNVER, " running on %s"
+STRING_COPY_FILE , " %d file(s) copied\n"
+STRING_DELETE_WIPE, "wiped"
+STRING_FOR_ERROR, "bad variable specification."
+STRING_SCREEN_COL, "invalid value for col"
+STRING_SCREEN_ROW, "invalid value for row"
+STRING_TIMER_TIME "Timer %d is %s: "
}
_____
Modified: trunk/reactos/subsys/system/cmd/chcp.c
--- trunk/reactos/subsys/system/cmd/chcp.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/chcp.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -22,8 +22,7 @@
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
LPTSTR *arg;
- INT args;
- UINT uOldCodePage;
+ INT args;
UINT uNewCodePage;
/* print help */
@@ -52,10 +51,6 @@
return 1;
}
-
- /* save old code page */
- uOldCodePage = InputCodePage;
-
uNewCodePage = (UINT)_ttoi(arg[0]);
if (uNewCodePage == 0)
_____
Modified: trunk/reactos/subsys/system/cmd/cmd.c
--- trunk/reactos/subsys/system/cmd/cmd.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/cmd.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -637,14 +637,14 @@
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1,
szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, in);
return;
}
if (!SetStdHandle (STD_INPUT_HANDLE, hFile))
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1,
szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, in);
return;
}
@@ -669,7 +669,7 @@
TRUNCATE_EXISTING,
FILE_ATTRIBUTE_TEMPORARY, NULL);
if (hFile[1] == INVALID_HANDLE_VALUE)
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR2, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR2,
szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg);
return;
}
@@ -722,14 +722,14 @@
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3,
szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, out);
return;
}
if (!SetStdHandle (STD_OUTPUT_HANDLE, hFile))
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3,
szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, out);
return;
}
@@ -783,7 +783,7 @@
NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle,
STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, err);
return;
}
@@ -791,7 +791,7 @@
if (!SetStdHandle (STD_ERROR_HANDLE, hFile))
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3,
szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, err);
return;
}
@@ -1248,7 +1248,7 @@
if (IsExistingFile (_T("commandline")))
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR4, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR4,
szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, commandline);
ParseCommandLine (commandline);
}
@@ -1309,7 +1309,7 @@
if (IsExistingFile (_T("commandline")))
{
- LoadString(GetModuleHandle(NULL),
STRING_CMD_ERROR4, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_CMD_ERROR4,
szMsg, RC_STRING_MAX_SIZE);
ConErrPrintf(szMsg, commandline);
ParseCommandLine (commandline);
}
_____
Modified: trunk/reactos/subsys/system/cmd/cmd.h
--- trunk/reactos/subsys/system/cmd/cmd.h 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/cmd.h 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -31,17 +31,6 @@
#include "cmdver.h"
-#ifdef _MSC_VER
-#define SHELLVER "Version " CMD_VER " [" __DATE__ ",
msc]"
-#else
-#ifdef __LCC__
-#define SHELLVER "Version " CMD_VER " [" __DATE__ ",
lcc-win32]"
-#else
-#define SHELLVER "Version " CMD_VER " [" __DATE__ "]"
-#endif
-#endif
-
-
#define BREAK_BATCHFILE 1
#define BREAK_OUTOFBATCH 2
#define BREAK_INPUT 3
_____
Modified: trunk/reactos/subsys/system/cmd/copy.c
--- trunk/reactos/subsys/system/cmd/copy.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/copy.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -630,6 +630,7 @@
TCHAR dir_d[_MAX_DIR];
TCHAR file_d[_MAX_FNAME];
TCHAR ext_d[_MAX_EXT];
+ TCHAR szMsg[RC_STRING_MAX_SIZE];
int argc;
int append;
@@ -758,7 +759,9 @@
DeleteFileList (sources);
freep ((VOID*)p);
- ConOutPrintf (_T(" %d file(s) copied\n"), copied);
+
+ LoadString( CMD_ModuleHandle, STRING_COPY_FILE, (LPTSTR)
szMsg,sizeof(szMsg));
+ ConOutPrintf (szMsg, copied);
return 1;
}
_____
Modified: trunk/reactos/subsys/system/cmd/del.c
--- trunk/reactos/subsys/system/cmd/del.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/del.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -71,7 +71,10 @@
HANDLE fh;
WIN32_FIND_DATA f;
LONGLONG FileSize;
+ TCHAR szMsg[RC_STRING_MAX_SIZE];
+ LoadString( CMD_ModuleHandle, STRING_DELETE_WIPE,
(LPTSTR) szMsg,sizeof(szMsg));
+
fh = FindFirstFile(lpFileName, &f);
FileSize = ((LONGLONG)f.nFileSizeHigh *
((LONGLONG)MAXDWORD+1)) + (LONGLONG)f.nFileSizeLow;
@@ -83,10 +86,10 @@
for(i = 0; i < (FileSize - BufferSize); i += BufferSize)
{
WriteFile (file, buffer, BufferSize, &temp,
NULL);
- ConOutPrintf (_T("%I64d%% wiped\r"),(i *
(LONGLONG)100)/FileSize);
+ ConOutPrintf (_T("%I64d%% %s\r"),(i *
(LONGLONG)100)/FileSize,szMsg);
}
WriteFile (file, buffer, FileSize - i, &temp, NULL);
- ConOutPrintf (_T("100%% wiped\n"));
+ ConOutPrintf (_T("100%% %s\n"),szMsg);
CloseHandle (file);
}
@@ -246,7 +249,7 @@
ConErrPrintf(szMsg, szFullPath);
LoadString(CMD_ModuleHandle, STRING_DEL_ERROR6, szMsg,
RC_STRING_MAX_SIZE);
- res =
FilePromptYN ((LPTSTR)szMsg);
+ res =
FilePromptYN (szMsg);
if ((res ==
PROMPT_NO) || (res == PROMPT_BREAK))
{
@@ -316,7 +319,7 @@
ConErrPrintf(szMsg,
szFullPath);
LoadString(CMD_ModuleHandle, STRING_DEL_ERROR6, szMsg,
RC_STRING_MAX_SIZE);
- res = FilePromptYN
((LPTSTR)szMsg);
+ res = FilePromptYN
(szMsg);
if ((res == PROMPT_NO)
|| (res == PROMPT_BREAK))
{
_____
Modified: trunk/reactos/subsys/system/cmd/dir.c
--- trunk/reactos/subsys/system/cmd/dir.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/dir.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -847,7 +847,7 @@
if (szVolName[0] != _T('\0'))
{
LoadString(CMD_ModuleHandle, STRING_DIR_HELP2, szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf((LPTSTR)szMsg, szRootName[0], szVolName);
+ ConOutPrintf(szMsg, szRootName[0], szVolName);
}
else
{
@@ -857,7 +857,7 @@
/* print the volume serial number if the return was successful */
LoadString(CMD_ModuleHandle, STRING_DIR_HELP4, (LPTSTR) szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf((LPTSTR)szMsg,
+ ConOutPrintf(szMsg,
HIWORD(dwSerialNr),
LOWORD(dwSerialNr));
@@ -1102,7 +1102,7 @@
GetUserDiskFreeSpace(szRoot, &uliFree);
ConvertULargeInteger(uliFree, szBuffer, sizeof(szBuffer),
lpFlags->bTSeperator);
LoadString(CMD_ModuleHandle, STRING_DIR_HELP6, (LPTSTR) szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf((LPTSTR)szMsg,ulDirs, szBuffer);
+ ConOutPrintf(szMsg,ulDirs, szBuffer);
return 0;
}
_____
Modified: trunk/reactos/subsys/system/cmd/for.c
--- trunk/reactos/subsys/system/cmd/for.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/for.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -49,11 +49,11 @@
*/
INT cmd_for (LPTSTR cmd, LPTSTR param)
-{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
+{
LPBATCH_CONTEXT lpNew;
LPTSTR pp;
TCHAR var;
+ TCHAR szMsg[RC_STRING_MAX_SIZE];
#ifdef _DEBUG
DebugPrintf (_T("cmd_for (\'%s\', \'%s\'\n"), cmd, param);
@@ -68,7 +68,8 @@
/* Check that first element is % then an alpha char followed by
space */
if ((*param != _T('%')) || !_istalpha (*(param + 1)) ||
!_istspace (*(param + 2)))
{
- error_syntax (_T("bad variable specification."));
+ LoadString( CMD_ModuleHandle, STRING_FOR_ERROR, (LPTSTR)
szMsg,sizeof(szMsg));
+ error_syntax (szMsg);
return 1;
}
_____
Modified: trunk/reactos/subsys/system/cmd/ren.c
--- trunk/reactos/subsys/system/cmd/ren.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/ren.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -253,7 +253,7 @@
LoadString( CMD_ModuleHandle, STRING_REN_HELP2, szMsg,
RC_STRING_MAX_SIZE);
else
LoadString( CMD_ModuleHandle, STRING_REN_HELP3, szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf((LPTSTR)szMsg,dwFiles);
+ ConOutPrintf(szMsg,dwFiles);
}
freep(arg);
_____
Modified: trunk/reactos/subsys/system/cmd/resource.h
--- trunk/reactos/subsys/system/cmd/resource.h 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/resource.h 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -208,6 +208,13 @@
#define STRING_WINDOW_HELP1 710
#define STRING_WINDOW_HELP2 711
+#define STRING_COPY_FILE 712
+#define STRING_DELETE_WIPE 713
+#define STRING_FOR_ERROR 714
+#define STRING_SCREEN_COL 715
+#define STRING_SCREEN_ROW 716
+#define STRING_TIMER_TIME 717
+
/* These strings are language independent (cmd.rc) */
#define STRING_FREEDOS_DEV 800
#define STRING_REACTOS_DEV 801
_____
Modified: trunk/reactos/subsys/system/cmd/screen.c
--- trunk/reactos/subsys/system/cmd/screen.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/screen.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -41,7 +41,7 @@
y = _ttoi(param);
if (y<0 || y>(maxy-1))
{
- ConOutPrintf(_T("invalid value for row"));
+ ConOutResPuts(STRING_SCREEN_ROW);
return 1;
}
@@ -64,7 +64,7 @@
x = _ttoi(param);
if (x<0 || x>(maxx-1))
{
- ConErrPuts(_T("invalid value for col"));
+ ConErrResPuts(STRING_SCREEN_COL);
return 1;
}
_____
Modified: trunk/reactos/subsys/system/cmd/timer.c
--- trunk/reactos/subsys/system/cmd/timer.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/timer.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -19,10 +19,8 @@
-//print timer status
-#define PS ConOutPrintf(_T("Timer %d is %s:
"),clk_n,cS?_T("ON"):_T("OFF")); \
- PrintTime()
+
//print timer value
#define PT(format) PrintElapsedTime(GetTickCount()-cT,format)
@@ -109,6 +107,7 @@
return 0;
}
+ LoadString( CMD_ModuleHandle, STRING_TIMER_TIME, (LPTSTR)
szMsg,sizeof(szMsg));
p = split (param, &argc, FALSE);
@@ -161,7 +160,9 @@
{
cT=GetTickCount();
cS=TRUE;
- PS;
+
+ ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ PrintTime();
freep(p);
return 0;
}
@@ -169,8 +170,9 @@
if(bS)
{
if(cS)
- {
- PS;
+ {
+ ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ PrintTime();
PrintElapsedTime(GetTickCount()-cT, iFormat);
freep(p);
return 0;
@@ -178,7 +180,8 @@
cT=GetTickCount();
cS=TRUE;
- PS;
+ ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ PrintTime();
freep(p);
return 0;
}
@@ -188,7 +191,8 @@
if (cS)
{
cS=FALSE;
- PS;
+ ConOutPrintf
(szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ PrintTime();
PrintElapsedTime(GetTickCount()-cT, iFormat);
freep(p);
return 0;
@@ -196,7 +200,8 @@
cT=GetTickCount();
cS=TRUE;
- PS;
+ ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ PrintTime();
freep(p);
return 0;
}
@@ -207,12 +212,14 @@
if (cS)
{
cS=FALSE;
- PS;
+ ConOutPrintf
(szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ PrintTime();
PrintElapsedTime(GetTickCount()-cT, iFormat);
freep(p);
return 0;
}
- PS;
+ ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+ PrintTime();
freep(p);
return 0;
}
_____
Modified: trunk/reactos/subsys/system/cmd/ver.c
--- trunk/reactos/subsys/system/cmd/ver.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/ver.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -46,8 +46,8 @@
(RosVersion - VersionInfo.szCSDVersion);
if (7 <= RosVersionLen && 0 == _tcsnicmp(RosVersion,
_T("ReactOS"), 7))
{
- LoadString( GetModuleHandle(NULL),
STRING_VERSION_RUNVER, (LPTSTR) szMsg,sizeof(szMsg));
- ConOutPrintf ((LPTSTR)szMsg, RosVersion);
+ LoadString( CMD_ModuleHandle,
STRING_VERSION_RUNVER, (LPTSTR) szMsg,sizeof(szMsg));
+ ConOutPrintf (szMsg, RosVersion);
}
}
ConOutPuts (_T("\n"));
_____
Modified: trunk/reactos/subsys/system/cmd/verify.c
--- trunk/reactos/subsys/system/cmd/verify.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/verify.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -41,7 +41,7 @@
if (!*param)
{
LoadString(CMD_ModuleHandle, STRING_VERIFY_HELP2, szMsg,
RC_STRING_MAX_SIZE);
- ConOutPrintf((LPTSTR)szMsg, bVerify ? D_ON : D_OFF);
+ ConOutPrintf(szMsg, bVerify ? D_ON : D_OFF);
}
else if (_tcsicmp (param, D_OFF) == 0)
bVerify = FALSE;
_____
Modified: trunk/reactos/subsys/system/cmd/window.c
--- trunk/reactos/subsys/system/cmd/window.c 2005-05-08 16:53:32 UTC
(rev 15135)
+++ trunk/reactos/subsys/system/cmd/window.c 2005-05-08 17:33:17 UTC
(rev 15136)
@@ -159,7 +159,11 @@
wp.showCmd = SW_RESTORE;
if (iAction & A_CLOSE)
+ {
+#ifdef _DEBUG
ConErrPrintf(_T("!!!FIXME: CLOSE Not
implemented!!!\n"));
+#endif
+ }
wp.length = sizeof(WINDOWPLACEMENT);
SetWindowPlacement(hWnd, &wp);