- Retrieve the users short day names instead of hardcoded day names.
- Fix resources.

svn path=/trunk/; revision=74220
This commit is contained in:
Eric Kohl 2017-03-21 20:32:54 +00:00
parent 1b82948d08
commit 8f792acdab
3 changed files with 57 additions and 4 deletions

View file

@ -20,7 +20,55 @@
#include "resource.h"
PWSTR pszDaysOfWeekArray[] = {L"M", L"T", L"W", L"TH", L"F", L"S", L"SU", NULL};
PWSTR pszDaysOfWeekArray[7] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};
static
VOID
FreeDaysOfWeekArray(VOID)
{
INT i;
for (i = 0; i < 7; i++)
{
if (pszDaysOfWeekArray[i] != NULL)
HeapFree(GetProcessHeap(), 0, pszDaysOfWeekArray[i]);
}
}
static
BOOL
InitDaysOfWeekArray(VOID)
{
INT i, nLength;
for (i = 0; i < 7; i++)
{
nLength = GetLocaleInfo(LOCALE_USER_DEFAULT,
LOCALE_SABBREVDAYNAME1 + i,
NULL,
0);
pszDaysOfWeekArray[i] = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
nLength * sizeof(WCHAR));
if (pszDaysOfWeekArray[i] == NULL)
{
FreeDaysOfWeekArray();
return FALSE;
}
GetLocaleInfo(LOCALE_USER_DEFAULT,
LOCALE_SABBREVDAYNAME1 + i,
pszDaysOfWeekArray[i],
nLength);
}
return TRUE;
}
static
BOOL
@ -572,6 +620,9 @@ int wmain(int argc, WCHAR **argv)
/* Initialize the Console Standard Streams */
ConInitStdStreams();
if (!InitDaysOfWeekArray())
return 1;
/* Parse the computer name */
i = 1;
minIdx = 1;
@ -726,6 +777,8 @@ int wmain(int argc, WCHAR **argv)
}
done:
FreeDaysOfWeekArray();
if (bPrintUsage == TRUE)
ConResPuts(StdOut, IDS_USAGE);

View file

@ -18,7 +18,7 @@ Zeit Gibt die Zeit an, zu der ein Befehl ausgeführt werden soll.\
/NEXT:Datum[,...] ...\n\
""Befehl"" Ist der auszuführende Befehl oder das Stapelprogramm.\n"
IDS_CONFIRM_DELETE "Dieser Vorgang wird alle geplanten Aufräge löschen.\nMöchten Sie diesen Vorgang fortsetzen? (J/N) [N]"
IDS_CONFIRM_DELETE "Dieser Vorgang wird alle geplanten Aufräge löschen.\nMöchten Sie diesen Vorgang fortsetzen? (J/N) [N] "
IDS_NEW_JOB "Neuer Auftrag hinzugefügt. Kennung = %lu\n"
IDS_JOBS_LIST "Statuskenn. Tag Zeit Befehlszeile\n"
IDS_NO_ENTRIES "Es sind keine Einträge in der Liste.\n"
@ -26,7 +26,7 @@ Zeit Gibt die Zeit an, zu der ein Befehl ausgeführt werden soll.\
IDS_TODAY "Heute"
IDS_TOMORROW "Morgen"
IDS_EVERY "Jeden"
IDS_NEXT "Nächsten"
IDS_NEXT "Kommenden"
IDS_YES "Ja"
IDS_NO "Nein"

View file

@ -27,7 +27,7 @@ Zeit Specifies the time when command is to run.\n\
current day of the month is assumed.\n\
""command"" Is the command or batch program to be run.\n"
IDS_CONFIRM_DELETE "This operation will delete all seduled jobs.\nDo you want to continue this operation? (Y/N) [N]: "
IDS_CONFIRM_DELETE "This operation will delete all seduled jobs.\nDo you want to continue this operation? (Y/N) [N] "
IDS_NEW_JOB "Added a new job with job ID = %lu\n"
IDS_JOBS_LIST "Status ID Day Time Command Line\n"
IDS_NO_ENTRIES "There are no entries in the list.\n"