31 #define YEAR_STR_MAX_SIZE 5 32 #define MAX_SHRT_DATE_SEPARATORS 3 33 #define STD_DATE_SEP L"." 34 #define YEAR_DIFF (99) 35 #define MAX_YEAR (9999) 56 UINT nDateCompCount=0;
60 if (pszFoundSep ==
NULL)
65 while (nDateCompCount <
wcslen(szSourceStr))
67 if (!
isDateCompAl(szSourceStr[nDateCompCount]) && (szSourceStr[nDateCompCount] !=
L'\''))
69 while (!
isDateCompAl(szSourceStr[nDateCompCount]) && (szSourceStr[nDateCompCount] !=
L'\''))
71 pszFoundSep[nDateSepCount++] = szSourceStr[nDateCompCount];
75 pszFoundSep[nDateSepCount] =
L'\0';
102 nSepStrSize =
wcslen(pszShortDateSep);
105 for (nSepCount = 0; nSepCount < nSepStrSize; nSepCount++)
107 if (
iswalnum(pszShortDateSep[nSepCount]) || (pszShortDateSep[nSepCount] ==
L'\''))
114 if (nSepStrSize == 0)
148 nFmtStrSize =
wcslen(pszShortDateFmt);
151 for (nDateCompCount = 0; nDateCompCount < nFmtStrSize; nDateCompCount++)
153 if (pszShortDateFmt[nDateCompCount] ==
L'\'')
155 OpenApostFlg = !OpenApostFlg;
158 if (
iswalnum(pszShortDateFmt[nDateCompCount]) &&
167 if (OpenApostFlg || nFmtStrSize == 0)
174 if (pszFoundSep !=
NULL)
177 wcscpy(szFoundDateSep, pszFoundSep);
178 pszResultStr =
ReplaceSubStr(pszShortDateFmt, szShortDateSep, szFoundDateSep);
179 if (pszResultStr !=
NULL)
181 wcscpy(pszShortDateFmt, pszResultStr);
206 nFmtStrSize =
wcslen(pszLongDateFmt);
209 for (nDateCompCount = 0; nDateCompCount < nFmtStrSize; nDateCompCount++)
211 if (pszLongDateFmt[nDateCompCount] ==
L'\'')
213 OpenApostFlg = !OpenApostFlg;
216 if (
iswalnum(pszLongDateFmt[nDateCompCount]) &&
225 if (OpenApostFlg || nFmtStrSize == 0)
259 (
LPARAM)ShortDateSepSamples[nCBIndex]);
288 (
LPARAM)lpTimeFormatString);
415 CAL_ITWODIGITYEARMAX | CAL_RETURN_NUMBER,
565 pGlobalData->bEnableYearNotification =
TRUE;
573 pGlobalData !=
NULL &&
574 pGlobalData->bEnableYearNotification ==
TRUE)
603 pGlobalData->bUserLocaleChanged =
TRUE;
#define IDC_LONGDATEFMT_COMBO
static VOID InitShortDateSepSamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
static VOID InitMinMaxDateSpin(HWND hwndDlg, PGLOBALDATA pGlobalData)
struct _GLOBALDATA * PGLOBALDATA
PWSTR ReplaceSubStr(PCWSTR szSourceStr, PCWSTR szStrToReplace, PCWSTR szTempl)
#define IDC_LONGDATESAMPLE_EDIT
#define IDS_ERROR_SYMBOL_SEPARATE
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
static VOID UpdateDateLocaleSamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
static BOOL SetShortDateSep(HWND hwndDlg, PWSTR pszShortDateSep)
_CRTIMP wchar_t *__cdecl _itow(_In_ int _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
#define IDC_SHRTDATESAMPLE_EDIT
#define IDC_FIRSTYEAR_EDIT
#define MAX_SHORTDATEFORMAT
#define IDS_ERROR_SYMBOL_FORMAT_SHORT
static BOOL CALLBACK ShortDateFormatEnumProc(PWSTR lpTimeFormatString)
static BOOL SetLongDateFormat(HWND hwndDlg, PWSTR pszLongDateFmt)
WCHAR szDateSep[MAX_DATESEPARATOR]
static BOOL GetDateSetting(HWND hwndDlg, PGLOBALDATA pGlobalData)
static VOID SetMaxDate(HWND hwndDlg, LCID lcid)
#define MAX_SAMPLES_STR_SIZE
WCHAR szLongDateFormat[MAX_LONGDATEFORMAT]
#define MAX_SHRT_DATE_SEPARATORS
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
#define MAX_DATESEPARATOR
#define YEAR_STR_MAX_SIZE
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL isDateCompAl(WCHAR alpha)
VOID InitShortDateCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
HWND WINAPI GetParent(_In_ HWND)
LPTSTR FindDateSep(const WCHAR *szSourceStr)
static BOOL SetShortDateFormat(HWND hwndDlg, PWSTR pszShortDateFmt)
WCHAR szShortDateFormat[MAX_SHORTDATEFORMAT]
INT_PTR CALLBACK DatePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define IDC_SHRTDATEFMT_COMBO
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static VOID SetMinDate(HWND hwndDlg)
static VOID InitLongDateCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
#define IDC_SECONDYEAR_EDIT
GLclampf GLclampf GLclampf alpha
#define IDC_SHRTDATESEP_COMBO
#define IDC_CALTYPE_COMBO
#define IDC_HIJCHRON_COMBO
VOID PrintErrorMsgBox(UINT msg)
static INT GetMaxDate(LCID lcid)
#define HeapFree(x, y, z)
#define MAX_LONGDATEFORMAT
#define IDS_ERROR_SYMBOL_FORMAT_LONG