Remove more hardcode string to En.rc

svn path=/trunk/; revision=14534
This commit is contained in:
Magnus Olsen 2005-04-07 11:24:38 +00:00
parent 68c2c91476
commit 98b6f6bd7b
5 changed files with 141 additions and 76 deletions

View file

@ -147,10 +147,69 @@ ERASE [/%c /%c /%c /%c /%c /%c /%c] file ...\n\n \
/%c Yes. Kill even *.* without asking.\n \ /%c Yes. Kill even *.* without asking.\n \
/%c Zap. Delete hidden, read-only and system files).\n" /%c Zap. Delete hidden, read-only and system files).\n"
STRING_DEL_HELP2, "All files in the directory will be deleted!\nAre you sure (Y/N)?"
STRING_DEL_HELP3, " %lu file deleted\n" STRING_DEL_HELP3, " %lu file deleted\n"
STRING_DEL_HELP4, " %lu files deleted\n" STRING_DEL_HELP4, " %lu files deleted\n"
STRING_DELAY_HELP, "pause for n seconds or milliseconds\n \
DELAY [/m]n\n\n \
/m specifiy than n are milliseconds\n \
otherwise n are seconds"
STRING_DIR_HELP1, "DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n \
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n\n \
[drive:][path][filename]\n \
Specifies drive, directory, and/or files to list.\n\n \
/A Displays files with specified attributes.\n \
attributes D Directories R Read-only files\n \
H Hidden files A Files ready for archiving\n \
S System files - Prefix meaning not\n \
/B Uses bare format (no heading information or summary).\n \
/C Display the thousand separator in file sizes. This is the\n \
default. Use /-C to disable display of separator.\n \
/D Same as wide but files are list sorted by column.\n \
/L Uses lowercase.\n \
/N New long list format where filenames are on the far right.\n \
/O List by files in sorted order.\n \
sortorder N By name (alphabetic) S By size (smallest first)\n \
E By extension (alphabetic) D By date/time (oldest first)\n \
G Group directories first - Prefix to reverse order\n \
/P Pauses after each screenful of information.\n \
/Q Display the owner of the file.\n \
/S Displays files in specified directory and all subdirectories.\n \
/T Controls which time field displayed or used for sorting\n \
timefield C Creation\n \
A Last Access\n \
W Last Written\n \
/W Uses wide list format.\n \
/X This displays the short names generated for non-8dot3 file\n \
names. The format is that of /N with the short name inserted\n \
before the long name. If no short name is present, blanks are\n \
displayed in its place.\n \
/4 Displays four-digit years\n\n \
Switches may be preset in the DIRCMD environment variable. Override\n \
preset switches by prefixing any switch with - (hyphen)--for example, /-W.\n "
STRING_DIR_HELP2, " Volume in drive %c is %s"
STRING_DIR_HELP3, " Volume in drive %c has no label"
STRING_DIR_HELP4, " Volume Serial Number is %04X-%04X\n"
STRING_DIR_HELP5, "\n Total Files Listed:\n%16i File(s)% 14s bytes\n"
STRING_DIR_HELP6, "%16i Dir(s)% 15s bytes\n"
STRING_DIR_HELP7, "\n Directory of %s\n\n"
STRING_DIR_HELP8, "%16i Dir(s)% 14s bytes\n"
STRING_DIRSTACK_HELP1, "Stores the current directory for use by the POPD command, then\n \
changes to the specified directory.\n\n \
PUSHD [path | ..]\n\n \
path Specifies the directory to make the current directory"
STRING_DIRSTACK_HELP2, "Changes to the directory stored by the PUSHD command.\n\nPOPD"
STRING_DIRSTACK_HELP3, "Prints the contents of the directory stack.\n\nDIRS"
STRING_DIRSTACK_HELP4, "Directory stack empty"
STRING_EXIT_HELP, "Exits the command line interpreter.\n\nEXIT" STRING_EXIT_HELP, "Exits the command line interpreter.\n\nEXIT"
STRING_MKDIR_HELP, "Creates a directory.\n\n \ STRING_MKDIR_HELP, "Creates a directory.\n\n \
@ -161,7 +220,8 @@ RMDIR [drive:]path\nRD [drive:]path"
STRING_REM_HELP, "Starts a comment line in a batch file.\n\nREM [Comment]" STRING_REM_HELP, "Starts a comment line in a batch file.\n\nREM [Comment]"
STRING_DEL_HELP2, "All files in the directory will be deleted!\nAre you sure (Y/N)?"

View file

@ -10,6 +10,7 @@
*/ */
#include "precomp.h" #include "precomp.h"
#include "resource.h"
#ifdef INCLUDE_CMD_DELAY #ifdef INCLUDE_CMD_DELAY
@ -18,17 +19,14 @@ INT CommandDelay (LPTSTR cmd, LPTSTR param)
{ {
DWORD val; DWORD val;
DWORD mul=1000; DWORD mul=1000;
WCHAR szMsg[RC_STRING_MAX_SIZE];
if (_tcsncmp (param, _T("/?"), 2) == 0) if (_tcsncmp (param, _T("/?"), 2) == 0)
{ {
ConOutPuts(_T( LoadString( GetModuleHandle(NULL), STRING_DELAY_HELP, (LPTSTR) szMsg,sizeof(szMsg));
"pause for n seconds or milliseconds" ConOutPuts (_T((LPTSTR)szMsg));
"\n"
"DELAY [/m]n\n" return 0;
"\n"
" /m specifiy than n are milliseconds\n"
" otherwise n are seconds"));
return 0;
} }
if (*param==0) if (*param==0)

View file

@ -129,6 +129,7 @@
*/ */
#include "precomp.h" #include "precomp.h"
#include "resource.h"
#ifdef INCLUDE_CMD_DIR #ifdef INCLUDE_CMD_DIR
@ -209,44 +210,9 @@ static ULARGE_INTEGER recurse_bytes;
static VOID static VOID
DirHelp (VOID) DirHelp (VOID)
{ {
ConOutPuts(_T( WCHAR szMsg[RC_STRING_MAX_SIZE];
"DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]\n" LoadString( GetModuleHandle(NULL), STRING_DIR_HELP1, (LPTSTR) szMsg,sizeof(szMsg));
" [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]\n" ConOutPuts (_T((LPTSTR)szMsg));
"\n"
" [drive:][path][filename]\n"
" Specifies drive, directory, and/or files to list.\n"
"\n"
" /A Displays files with specified attributes.\n"
" attributes D Directories R Read-only files\n"
" H Hidden files A Files ready for archiving\n"
" S System files - Prefix meaning not\n"
" /B Uses bare format (no heading information or summary).\n"
" /C Display the thousand separator in file sizes. This is the\n"
" default. Use /-C to disable display of separator.\n"
" /D Same as wide but files are list sorted by column.\n"
" /L Uses lowercase.\n"
" /N New long list format where filenames are on the far right.\n"
" /O List by files in sorted order.\n"
" sortorder N By name (alphabetic) S By size (smallest first)\n"
" E By extension (alphabetic) D By date/time (oldest first)\n"
" G Group directories first - Prefix to reverse order\n"
" /P Pauses after each screenful of information.\n"
" /Q Display the owner of the file.\n"
" /S Displays files in specified directory and all subdirectories.\n"
" /T Controls which time field displayed or used for sorting\n"
" timefield C Creation\n"
" A Last Access\n"
" W Last Written\n"
" /W Uses wide list format.\n"
" /X This displays the short names generated for non-8dot3 file\n"
" names. The format is that of /N with the short name inserted\n"
" before the long name. If no short name is present, blanks are\n"
" displayed in its place.\n"
" /4 Displays four-digit years\n"
" \n"
"Switches may be preset in the DIRCMD environment variable. Override\n"
"preset switches by prefixing any switch with - (hyphen)--for example, /-W.\n"
));
} }
@ -807,6 +773,7 @@ PrintDirectoryHeader (LPTSTR szPath, LPINT pLine, LPDIRSWITCHFLAGS lpFlags)
TCHAR szVolName[80]; TCHAR szVolName[80];
DWORD dwSerialNr; DWORD dwSerialNr;
LPTSTR p; LPTSTR p;
WCHAR szMsg[RC_STRING_MAX_SIZE];
if (lpFlags->bBareFormat) if (lpFlags->bBareFormat)
return(TRUE); return(TRUE);
@ -858,17 +825,27 @@ PrintDirectoryHeader (LPTSTR szPath, LPINT pLine, LPDIRSWITCHFLAGS lpFlags)
} }
/* print drive info */ /* print drive info */
ConOutPrintf(_T(" Volume in drive %c"), szRootName[0]);
if (szVolName[0] != _T('\0')) if (szVolName[0] != _T('\0'))
ConOutPrintf(_T(" is %s\n"), szVolName); {
LoadString( GetModuleHandle(NULL), STRING_DIR_HELP2, (LPTSTR) szMsg,sizeof(szMsg));
ConOutPrintf (_T((LPTSTR)szMsg), szRootName[0], szVolName);
}
else else
ConOutPrintf(_T(" has no label\n")); {
LoadString( GetModuleHandle(NULL), STRING_DIR_HELP3, (LPTSTR) szMsg,sizeof(szMsg));
ConOutPrintf (_T((LPTSTR)szMsg), szRootName[0]);
}
/* print the volume serial number if the return was successful */ /* print the volume serial number if the return was successful */
ConOutPrintf(_T(" Volume Serial Number is %04X-%04X\n"),
HIWORD(dwSerialNr), LoadString( GetModuleHandle(NULL), STRING_DIR_HELP4, (LPTSTR) szMsg,sizeof(szMsg));
LOWORD(dwSerialNr)); ConOutPrintf (_T((LPTSTR)szMsg),
HIWORD(dwSerialNr),
LOWORD(dwSerialNr));
return(TRUE); return(TRUE);
} }
@ -1079,6 +1056,7 @@ PrintSummary(LPTSTR szPath,
TCHAR szBuffer[64]; TCHAR szBuffer[64];
ULARGE_INTEGER uliFree; ULARGE_INTEGER uliFree;
TCHAR szRoot[] = _T("A:\\"); TCHAR szRoot[] = _T("A:\\");
WCHAR szMsg[RC_STRING_MAX_SIZE];
/* Here we check if we didn't find anything */ /* Here we check if we didn't find anything */
@ -1095,15 +1073,17 @@ TCHAR szRoot[] = _T("A:\\");
if (lpFlags->bRecursive) if (lpFlags->bRecursive)
{ {
ConvertULargeInteger (u64Bytes, szBuffer, sizeof(szBuffer), lpFlags->bTSeperator); ConvertULargeInteger (u64Bytes, szBuffer, sizeof(szBuffer), lpFlags->bTSeperator);
ConOutPrintf (_T("\n Total Files Listed:\n"));
ConOutPrintf(_T("%16i File(s)% 14s bytes\n"),ulFiles, szBuffer); LoadString( GetModuleHandle(NULL), STRING_DIR_HELP5, (LPTSTR) szMsg,sizeof(szMsg));
ConOutPrintf (_T((LPTSTR)szMsg),ulFiles, szBuffer);
} }
/* Print total directories and freespace */ /* Print total directories and freespace */
szRoot[0] = szPath[0]; szRoot[0] = szPath[0];
GetUserDiskFreeSpace(szRoot, &uliFree); GetUserDiskFreeSpace(szRoot, &uliFree);
ConvertULargeInteger (uliFree, szBuffer, sizeof(szBuffer), lpFlags->bTSeperator); ConvertULargeInteger (uliFree, szBuffer, sizeof(szBuffer), lpFlags->bTSeperator);
ConOutPrintf (_T("%16i Dir(s)% 15s bytes\n"),ulDirs, szBuffer); LoadString( GetModuleHandle(NULL), STRING_DIR_HELP6, (LPTSTR) szMsg,sizeof(szMsg));
ConOutPrintf (_T((LPTSTR)szMsg),ulDirs, szBuffer);
return 0; return 0;
} }
@ -1408,6 +1388,7 @@ DirPrintFiles(LPWIN32_FIND_DATA ptrFiles[], /* [IN] Files' Info */
LPDIRSWITCHFLAGS lpFlags) /* [IN] The flags used */ LPDIRSWITCHFLAGS lpFlags) /* [IN] The flags used */
{ {
TCHAR szTemp[MAX_PATH]; /* A buffer to format the directory header */ TCHAR szTemp[MAX_PATH]; /* A buffer to format the directory header */
WCHAR szMsg[RC_STRING_MAX_SIZE];
/* Print directory header */ /* Print directory header */
_tcscpy(szTemp, szCurPath); _tcscpy(szTemp, szCurPath);
@ -1417,7 +1398,10 @@ TCHAR szTemp[MAX_PATH]; /* A buffer to format the directory header */
We are not printing in bare format We are not printing in bare format
and if we are in recursive mode... we must have results */ and if we are in recursive mode... we must have results */
if (!(lpFlags->bBareFormat ) && !((lpFlags->bRecursive) && (dwCount <= 0))) if (!(lpFlags->bBareFormat ) && !((lpFlags->bRecursive) && (dwCount <= 0)))
ConOutPrintf("\n Directory of %s\n\n", szTemp); {
LoadString( GetModuleHandle(NULL), STRING_DIR_HELP7, (LPTSTR) szMsg,sizeof(szMsg));
ConOutPrintf (_T( (LPTSTR)szMsg), szTemp);
}
/* Bare format */ /* Bare format */
if (lpFlags->bBareFormat) if (lpFlags->bBareFormat)
@ -1626,6 +1610,7 @@ DWORD dwCountFiles; /* Counter for files */
DWORD dwCountDirs; /* Counter for directories */ DWORD dwCountDirs; /* Counter for directories */
ULARGE_INTEGER u64CountBytes; /* Counter for bytes */ ULARGE_INTEGER u64CountBytes; /* Counter for bytes */
ULARGE_INTEGER u64Temp; /* A temporary counter */ ULARGE_INTEGER u64Temp; /* A temporary counter */
WCHAR szMsg[RC_STRING_MAX_SIZE];
/* Initialize Variables */ /* Initialize Variables */
ptrStartNode = NULL; ptrStartNode = NULL;
@ -1743,8 +1728,8 @@ ULARGE_INTEGER u64Temp; /* A temporary counter */
if (!(lpFlags->bBareFormat) && (dwCount > 0)) if (!(lpFlags->bBareFormat) && (dwCount > 0))
{ {
ConvertULargeInteger(u64CountBytes, szBytes, 20, lpFlags->bTSeperator); ConvertULargeInteger(u64CountBytes, szBytes, 20, lpFlags->bTSeperator);
ConOutPrintf(_T("%16i File(s) %14s bytes\n"), LoadString( GetModuleHandle(NULL), STRING_DIR_HELP8, (LPTSTR) szMsg,sizeof(szMsg));
dwCountFiles, szBytes); ConOutPrintf (_T((LPTSTR)szMsg),dwCountFiles, szBytes);
} }
/* Add statistics to recursive statistics*/ /* Add statistics to recursive statistics*/

View file

@ -15,6 +15,7 @@
*/ */
#include "precomp.h" #include "precomp.h"
#include "resource.h"
#ifdef FEATURE_DIRECTORY_STACK #ifdef FEATURE_DIRECTORY_STACK
@ -139,13 +140,13 @@ INT CommandPushd (LPTSTR first, LPTSTR rest)
TCHAR curPath[MAX_PATH]; TCHAR curPath[MAX_PATH];
TCHAR newPath[MAX_PATH]; TCHAR newPath[MAX_PATH];
BOOL bChangePath = FALSE; BOOL bChangePath = FALSE;
WCHAR szMsg[RC_STRING_MAX_SIZE];
if (!_tcsncmp (rest, _T("/?"), 2)) if (!_tcsncmp (rest, _T("/?"), 2))
{ {
ConOutPuts (_T("Stores the current directory for use by the POPD command, then\n" LoadString( GetModuleHandle(NULL), STRING_DIRSTACK_HELP1, (LPTSTR) szMsg,sizeof(szMsg));
"changes to the specified directory.\n\n" ConOutPuts (_T((LPTSTR)szMsg));
"PUSHD [path | ..]\n\n"
" path Specifies the directory to make the current directory"));
return 0; return 0;
} }
@ -172,11 +173,13 @@ INT CommandPushd (LPTSTR first, LPTSTR rest)
INT CommandPopd (LPTSTR first, LPTSTR rest) INT CommandPopd (LPTSTR first, LPTSTR rest)
{ {
TCHAR szPath[MAX_PATH]; TCHAR szPath[MAX_PATH];
WCHAR szMsg[RC_STRING_MAX_SIZE];
if (!_tcsncmp(rest, _T("/?"), 2)) if (!_tcsncmp(rest, _T("/?"), 2))
{ {
ConOutPuts (_T("Changes to the directory stored by the PUSHD command.\n\n" LoadString( GetModuleHandle(NULL), STRING_DIRSTACK_HELP2, (LPTSTR) szMsg,sizeof(szMsg));
"POPD")); ConOutPuts (_T((LPTSTR)szMsg));
return 0; return 0;
} }
@ -198,12 +201,13 @@ INT CommandPopd (LPTSTR first, LPTSTR rest)
INT CommandDirs (LPTSTR first, LPTSTR rest) INT CommandDirs (LPTSTR first, LPTSTR rest)
{ {
LPDIRENTRY lpDir; LPDIRENTRY lpDir;
WCHAR szMsg[RC_STRING_MAX_SIZE];
if (!_tcsncmp(rest, _T("/?"), 2)) if (!_tcsncmp(rest, _T("/?"), 2))
{ {
ConOutPuts (_T("Prints the contents of the directory stack.\n" LoadString( GetModuleHandle(NULL), STRING_DIRSTACK_HELP3, (LPTSTR) szMsg,sizeof(szMsg));
"\n" ConOutPuts (_T((LPTSTR)szMsg));
"DIRS"));
return 0; return 0;
} }
@ -212,7 +216,9 @@ INT CommandDirs (LPTSTR first, LPTSTR rest)
if (lpDir == NULL) if (lpDir == NULL)
{ {
ConOutPuts (_T("Directory stack empty")); LoadString( GetModuleHandle(NULL), STRING_DIRSTACK_HELP4, (LPTSTR) szMsg,sizeof(szMsg));
ConOutPuts (_T((LPTSTR)szMsg));
return 0; return 0;
} }

View file

@ -65,10 +65,26 @@
#define STRING_DEL_HELP2 424 #define STRING_DEL_HELP2 424
#define STRING_DEL_HELP3 425 #define STRING_DEL_HELP3 425
#define STRING_DEL_HELP4 426 #define STRING_DEL_HELP4 426
#define STRING_EXIT_HELP 427 #define STRING_DELAY_HELP 427
#define STRING_MKDIR_HELP 428
#define STRING_RMDIR_HELP 429 #define STRING_DIR_HELP1 428
#define STRING_REM_HELP 430 #define STRING_DIR_HELP2 429
#define STRING_DIR_HELP3 430
#define STRING_DIR_HELP4 431
#define STRING_DIR_HELP5 432
#define STRING_DIR_HELP6 433
#define STRING_DIR_HELP7 434
#define STRING_DIR_HELP8 435
#define STRING_DIRSTACK_HELP1 436
#define STRING_DIRSTACK_HELP2 437
#define STRING_DIRSTACK_HELP3 438
#define STRING_DIRSTACK_HELP4 439
#define STRING_EXIT_HELP 440
#define STRING_MKDIR_HELP 441
#define STRING_RMDIR_HELP 442
#define STRING_REM_HELP 443