Update date and time examples according to the current settings.
CORE-10074

svn path=/trunk/; revision=69497
This commit is contained in:
Eric Kohl 2015-10-11 15:21:25 +00:00
parent 9d6572fbd3
commit b0c11b7004
3 changed files with 14 additions and 7 deletions

View file

@ -503,13 +503,15 @@ UpdateDateLocaleSamples(HWND hwndDlg,
WCHAR OutBuffer[MAX_SAMPLES_STR_SIZE];
/* Get short date format sample */
GetDateFormatW(pGlobalData->UserLCID, DATE_SHORTDATE, NULL, NULL, OutBuffer,
GetDateFormatW(pGlobalData->UserLCID, 0, NULL,
pGlobalData->szShortDateFormat, OutBuffer,
MAX_SAMPLES_STR_SIZE);
SendDlgItemMessageW(hwndDlg, IDC_SHRTDATESAMPLE_EDIT, WM_SETTEXT,
0, (LPARAM)OutBuffer);
/* Get long date sample */
GetDateFormatW(pGlobalData->UserLCID, DATE_LONGDATE, NULL, NULL, OutBuffer,
GetDateFormatW(pGlobalData->UserLCID, 0, NULL,
pGlobalData->szLongDateFormat, OutBuffer,
MAX_SAMPLES_STR_SIZE);
SendDlgItemMessageW(hwndDlg, IDC_LONGDATESAMPLE_EDIT,
WM_SETTEXT, 0, (LPARAM)OutBuffer);

View file

@ -127,20 +127,23 @@ UpdateLocaleSample(
ZeroMemory(OutBuffer, MAX_SAMPLES_STR_SIZE * sizeof(WCHAR));
/* Get time format sample */
GetTimeFormatW(pGlobalData->UserLCID, NO_FLAG, NULL, NULL,
GetTimeFormatW(pGlobalData->UserLCID, 0, NULL,
pGlobalData->szTimeFormat,
OutBuffer, MAX_SAMPLES_STR_SIZE);
SendDlgItemMessageW(hwndDlg, IDC_TIMESAMPLE_EDIT,
WM_SETTEXT, 0, (LPARAM)OutBuffer);
ZeroMemory(OutBuffer, MAX_SAMPLES_STR_SIZE * sizeof(WCHAR));
/* Get short date format sample */
GetDateFormatW(pGlobalData->UserLCID, DATE_SHORTDATE, NULL, NULL,
GetDateFormatW(pGlobalData->UserLCID, 0, NULL,
pGlobalData->szShortDateFormat,
OutBuffer, MAX_SAMPLES_STR_SIZE);
SendDlgItemMessageW(hwndDlg, IDC_SHORTTIMESAMPLE_EDIT,
WM_SETTEXT, 0, (LPARAM)OutBuffer);
/* Get long date sample */
GetDateFormatW(pGlobalData->UserLCID, DATE_LONGDATE, NULL, NULL,
GetDateFormatW(pGlobalData->UserLCID, 0, NULL,
pGlobalData->szLongDateFormat,
OutBuffer, MAX_SAMPLES_STR_SIZE);
SendDlgItemMessageW(hwndDlg, IDC_FULLTIMESAMPLE_EDIT,
WM_SETTEXT, 0, (LPARAM)OutBuffer);

View file

@ -41,9 +41,11 @@ TimeFormatEnumProc(PWSTR lpTimeFormatString)
static VOID
UpdateTimeSample(HWND hWnd, PGLOBALDATA pGlobalData)
{
WCHAR szBuffer[80];
WCHAR szBuffer[MAX_SAMPLES_STR_SIZE];
GetTimeFormatW(pGlobalData->UserLCID, 0, NULL, pGlobalData->szTimeFormat, szBuffer, 80);
GetTimeFormatW(pGlobalData->UserLCID, 0, NULL,
pGlobalData->szTimeFormat, szBuffer,
MAX_SAMPLES_STR_SIZE);
SendDlgItemMessageW(hWnd, IDC_TIMESAMPLE, WM_SETTEXT, 0, (LPARAM)szBuffer);
}