ReactOS  0.4.14-dev-390-g34947ad
date.c
Go to the documentation of this file.
1 /*
2  * ReactOS
3  * Copyright (C) 2004 ReactOS Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 /*
20  * PROJECT: ReactOS International Control Panel
21  * FILE: dll/cpl/intl/date.c
22  * PURPOSE: Date property page
23  * PROGRAMMERS: Eric Kohl
24  * Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
25  */
26 
27 #include "intl.h"
28 
29 /* GLOBALS ******************************************************************/
30 
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)
36 
37 static HWND hwndEnum = NULL;
38 
39 /* FUNCTIONS ****************************************************************/
40 
41 /* If char is 'y' or 'M' or 'd' return TRUE, else FALSE */
42 BOOL
44 {
45  if ((alpha == L'y') || (alpha == L'M') || (alpha == L'd') || (alpha == L' '))
46  return TRUE;
47  else
48  return FALSE;
49 }
50 
51 /* Find first date separator in string */
52 LPTSTR
53 FindDateSep(const WCHAR *szSourceStr)
54 {
55  PWSTR pszFoundSep;
56  UINT nDateCompCount=0;
57  UINT nDateSepCount=0;
58 
59  pszFoundSep = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, MAX_SAMPLES_STR_SIZE * sizeof(WCHAR));
60  if (pszFoundSep == NULL)
61  return NULL;
62 
63  wcscpy(pszFoundSep,STD_DATE_SEP);
64 
65  while (nDateCompCount < wcslen(szSourceStr))
66  {
67  if (!isDateCompAl(szSourceStr[nDateCompCount]) && (szSourceStr[nDateCompCount] != L'\''))
68  {
69  while (!isDateCompAl(szSourceStr[nDateCompCount]) && (szSourceStr[nDateCompCount] != L'\''))
70  {
71  pszFoundSep[nDateSepCount++] = szSourceStr[nDateCompCount];
72  nDateCompCount++;
73  }
74 
75  pszFoundSep[nDateSepCount] = L'\0';
76  return pszFoundSep;
77  }
78 
79  nDateCompCount++;
80  }
81 
82  return pszFoundSep;
83 }
84 
85 /* Replace given template in source string with string to replace and return received string */
86 
87 
88 /* Setted up short date separator to registry */
89 static BOOL
90 SetShortDateSep(HWND hwndDlg, PWSTR pszShortDateSep)
91 {
92  INT nSepStrSize;
93  INT nSepCount;
94 
95  /* Get separator */
97  WM_GETTEXT,
99  (LPARAM)pszShortDateSep);
100 
101  /* Get separator string size */
102  nSepStrSize = wcslen(pszShortDateSep);
103 
104  /* Check date components */
105  for (nSepCount = 0; nSepCount < nSepStrSize; nSepCount++)
106  {
107  if (iswalnum(pszShortDateSep[nSepCount]) || (pszShortDateSep[nSepCount] == L'\''))
108  {
110  return FALSE;
111  }
112  }
113 
114  if (nSepStrSize == 0)
115  {
117  return FALSE;
118  }
119 
120  return TRUE;
121 }
122 
123 /* Setted up short date format to registry */
124 static BOOL
125 SetShortDateFormat(HWND hwndDlg, PWSTR pszShortDateFmt)
126 {
127  WCHAR szShortDateSep[MAX_SAMPLES_STR_SIZE];
128  WCHAR szFoundDateSep[MAX_SAMPLES_STR_SIZE];
129  PWSTR pszResultStr;
130  PWSTR pszFoundSep;
131  BOOL OpenApostFlg = FALSE;
132  INT nFmtStrSize;
133  INT nDateCompCount;
134 
135  /* Get format */
137  WM_GETTEXT,
139  (LPARAM)pszShortDateFmt);
140 
141  /* Get separator */
143  WM_GETTEXT,
145  (LPARAM)szShortDateSep);
146 
147  /* Get format-string size */
148  nFmtStrSize = wcslen(pszShortDateFmt);
149 
150  /* Check date components */
151  for (nDateCompCount = 0; nDateCompCount < nFmtStrSize; nDateCompCount++)
152  {
153  if (pszShortDateFmt[nDateCompCount] == L'\'')
154  {
155  OpenApostFlg = !OpenApostFlg;
156  }
157 
158  if (iswalnum(pszShortDateFmt[nDateCompCount]) &&
159  !isDateCompAl(pszShortDateFmt[nDateCompCount]) &&
160  !OpenApostFlg)
161  {
163  return FALSE;
164  }
165  }
166 
167  if (OpenApostFlg || nFmtStrSize == 0)
168  {
170  return FALSE;
171  }
172 
173  pszFoundSep = FindDateSep(pszShortDateFmt);
174  if (pszFoundSep != NULL)
175  {
176  /* Substring replacement of separator */
177  wcscpy(szFoundDateSep, pszFoundSep);
178  pszResultStr = ReplaceSubStr(pszShortDateFmt, szShortDateSep, szFoundDateSep);
179  if (pszResultStr != NULL)
180  {
181  wcscpy(pszShortDateFmt, pszResultStr);
182  HeapFree(GetProcessHeap(), 0, pszResultStr);
183  }
184 
185  HeapFree(GetProcessHeap(), 0, pszFoundSep);
186  }
187 
188  return TRUE;
189 }
190 
191 /* Setted up long date format to registry */
192 static BOOL
193 SetLongDateFormat(HWND hwndDlg, PWSTR pszLongDateFmt)
194 {
195  BOOL OpenApostFlg = FALSE;
196  INT nFmtStrSize;
197  INT nDateCompCount;
198 
199  /* Get format */
201  WM_GETTEXT,
203  (LPARAM)pszLongDateFmt);
204 
205  /* Get format string size */
206  nFmtStrSize = wcslen(pszLongDateFmt);
207 
208  /* Check date components */
209  for (nDateCompCount = 0; nDateCompCount < nFmtStrSize; nDateCompCount++)
210  {
211  if (pszLongDateFmt[nDateCompCount] == L'\'')
212  {
213  OpenApostFlg = !OpenApostFlg;
214  }
215 
216  if (iswalnum(pszLongDateFmt[nDateCompCount]) &&
217  !isDateCompAl(pszLongDateFmt[nDateCompCount]) &&
218  !OpenApostFlg)
219  {
221  return FALSE;
222  }
223  }
224 
225  if (OpenApostFlg || nFmtStrSize == 0)
226  {
228  return FALSE;
229  }
230 
231  return TRUE;
232 }
233 
234 /* Init short date separator control box */
235 static VOID
237 {
238  PWSTR ShortDateSepSamples[MAX_SHRT_DATE_SEPARATORS] =
239  {
240  L".",
241  L"/",
242  L"-"
243  };
244  INT nCBIndex;
245  INT nRetCode;
246 
247  /* Clear all box content */
250  (WPARAM)0,
251  (LPARAM)0);
252 
253  /* Create standard list of separators */
254  for (nCBIndex = 0; nCBIndex < MAX_SHRT_DATE_SEPARATORS; nCBIndex++)
255  {
257  CB_ADDSTRING,
258  0,
259  (LPARAM)ShortDateSepSamples[nCBIndex]);
260  }
261 
262  /* Set current item to value from registry */
263  nRetCode = SendDlgItemMessageW(hwndDlg, IDC_SHRTDATESEP_COMBO,
265  -1,
266  (LPARAM)pGlobalData->szDateSep);
267 
268  /* If it is not successful, add new value to list and select them */
269  if (nRetCode == CB_ERR)
270  {
272  CB_ADDSTRING,
273  0,
274  (LPARAM)pGlobalData->szDateSep);
277  -1,
278  (LPARAM)pGlobalData->szDateSep);
279  }
280 }
281 
282 static BOOL CALLBACK
283 ShortDateFormatEnumProc(PWSTR lpTimeFormatString)
284 {
286  CB_ADDSTRING,
287  0,
288  (LPARAM)lpTimeFormatString);
289 
290  return TRUE;
291 }
292 
293 /* Init short date control box */
294 VOID
295 InitShortDateCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
296 {
297  INT nRetCode;
298 
299  /* Limit text lengths */
301  CB_LIMITTEXT,
303  0);
305  CB_LIMITTEXT,
307  0);
308 
309  /* Clear all box content */
312  (WPARAM)0,
313  (LPARAM)0);
314 
315  /* Enumerate short date formats */
318 
319  /* Set current item to value from registry */
320  nRetCode = SendDlgItemMessageW(hwndDlg, IDC_SHRTDATEFMT_COMBO,
322  -1,
323  (LPARAM)pGlobalData->szShortDateFormat);
324 
325  /* If it is not successful, add new value to list and select them */
326  if (nRetCode == CB_ERR)
327  {
329  CB_ADDSTRING,
330  0,
331  (LPARAM)pGlobalData->szShortDateFormat);
334  -1,
335  (LPARAM)pGlobalData->szShortDateFormat);
336  }
337 }
338 
339 /* Init long date control box */
340 static VOID
341 InitLongDateCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
342 {
343  INT nRetCode;
344 
345  /* Limit text length */
347  CB_LIMITTEXT,
349  0);
350 
351  /* Clear all box content */
354  (WPARAM)0,
355  (LPARAM)0);
356 
357  /* Enumerate short long formats */
360 
361  /* Set current item to value from registry */
362  nRetCode = SendDlgItemMessageW(hwndDlg, IDC_LONGDATEFMT_COMBO,
364  -1,
365  (LPARAM)pGlobalData->szLongDateFormat);
366 
367  /* If it is not successful, add new value to list and select them */
368  if (nRetCode == CB_ERR)
369  {
371  CB_ADDSTRING,
372  0,
373  (LPARAM)pGlobalData->szLongDateFormat);
376  -1,
377  (LPARAM)pGlobalData->szLongDateFormat);
378  }
379 }
380 
381 /* Set up max date value to registry */
382 static VOID
383 SetMaxDate(HWND hwndDlg, LCID lcid)
384 {
385  WCHAR szMaxDateVal[YEAR_STR_MAX_SIZE];
386  HWND hWndYearSpin;
387  INT nSpinVal;
388 
389  hWndYearSpin = GetDlgItem(hwndDlg, IDC_SCR_MAX_YEAR);
390 
391  /* Get spin value */
392  nSpinVal = LOWORD(SendMessageW(hWndYearSpin,
393  UDM_GETPOS,
394  0,
395  0));
396 
397  /* convert to wide char */
398  _itow(nSpinVal, szMaxDateVal, DECIMAL_RADIX);
399 
400  /* Save max date value */
401  SetCalendarInfoW(lcid,
403  48 , /* CAL_ITWODIGITYEARMAX */
404  (PCWSTR)szMaxDateVal);
405 }
406 
407 /* Get max date value from registry set */
408 static INT
410 {
411  INT nMaxDateVal = 0;
412 
413  GetCalendarInfoW(lcid,
415  CAL_ITWODIGITYEARMAX | CAL_RETURN_NUMBER,
416  NULL,
417  0, /* ret type - number */
418  (LPDWORD)&nMaxDateVal);
419 
420  return nMaxDateVal;
421 }
422 
423 /* Set's MIN data edit control value to MAX-99 */
424 static VOID
425 SetMinDate(HWND hwndDlg)
426 {
427  WCHAR OutBuffer[YEAR_STR_MAX_SIZE];
428  HWND hWndYearSpin;
429  INT nSpinVal;
430 
431  hWndYearSpin = GetDlgItem(hwndDlg, IDC_SCR_MAX_YEAR);
432 
433  /* Get spin value */
434  nSpinVal = LOWORD(SendMessageW(hWndYearSpin,
435  UDM_GETPOS,
436  0,
437  0));
438 
439  /* Set min year value */
440  wsprintf(OutBuffer, L"%d", (DWORD)nSpinVal - YEAR_DIFF);
442  WM_SETTEXT,
443  0,
444  (LPARAM)OutBuffer);
445 }
446 
447 /* Init spin control */
448 static VOID
449 InitMinMaxDateSpin(HWND hwndDlg, PGLOBALDATA pGlobalData)
450 {
451  WCHAR OutBuffer[YEAR_STR_MAX_SIZE];
452  HWND hWndYearSpin;
453 
454  /* Limit text lengths */
456  EM_LIMITTEXT,
458  0);
460  EM_LIMITTEXT,
462  0);
463 
464  hWndYearSpin = GetDlgItem(hwndDlg, IDC_SCR_MAX_YEAR);
465 
466  /* Init max date value */
467  wsprintf(OutBuffer, L"%04d", (DWORD)GetMaxDate(pGlobalData->UserLCID));
469  WM_SETTEXT,
470  0,
471  (LPARAM)OutBuffer);
472 
473  /* Init min date value */
474  wsprintf(OutBuffer, L"%04d", (DWORD)GetMaxDate(pGlobalData->UserLCID) - YEAR_DIFF);
476  WM_SETTEXT,
477  0,
478  (LPARAM)OutBuffer);
479 
480  /* Init updown control */
481  /* Set bounds */
482  SendMessageW(hWndYearSpin,
483  UDM_SETRANGE,
484  0,
486 
487  /* Set current value */
488  SendMessageW(hWndYearSpin,
489  UDM_SETPOS,
490  0,
491  MAKELONG(GetMaxDate(pGlobalData->UserLCID),0));
492 }
493 
494 /* Update all date locale samples */
495 static VOID
497  PGLOBALDATA pGlobalData)
498 {
499  WCHAR OutBuffer[MAX_SAMPLES_STR_SIZE];
500 
501  /* Get short date format sample */
502  GetDateFormatW(pGlobalData->UserLCID, 0, NULL,
503  pGlobalData->szShortDateFormat, OutBuffer,
506  0, (LPARAM)OutBuffer);
507 
508  /* Get long date sample */
509  GetDateFormatW(pGlobalData->UserLCID, 0, NULL,
510  pGlobalData->szLongDateFormat, OutBuffer,
513  WM_SETTEXT, 0, (LPARAM)OutBuffer);
514 }
515 
516 
517 static
518 BOOL
520  HWND hwndDlg,
521  PGLOBALDATA pGlobalData)
522 {
523  WCHAR szLongDateFormat[MAX_LONGDATEFORMAT];
524  WCHAR szShortDateFormat[MAX_SHORTDATEFORMAT];
525  WCHAR szDateSeparator[MAX_DATESEPARATOR];
526 
527  if (!SetLongDateFormat(hwndDlg, szLongDateFormat) ||
528  !SetShortDateFormat(hwndDlg, szShortDateFormat) ||
529  !SetShortDateSep(hwndDlg, szDateSeparator))
530  {
531  return FALSE;
532  }
533 
534  /* Store settings in global data */
535  wcscpy(pGlobalData->szLongDateFormat, szLongDateFormat);
536  wcscpy(pGlobalData->szShortDateFormat, szShortDateFormat);
537  wcscpy(pGlobalData->szDateSep, szDateSeparator);
538 
539  return TRUE;
540 }
541 
542 /* Property page dialog callback */
545  UINT uMsg,
546  WPARAM wParam,
547  LPARAM lParam)
548 {
549  PGLOBALDATA pGlobalData;
550 
551  pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
552 
553  switch (uMsg)
554  {
555  case WM_INITDIALOG:
556  pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
557  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
558 
559  InitMinMaxDateSpin(hwndDlg, pGlobalData);
560  UpdateDateLocaleSamples(hwndDlg, pGlobalData);
561  InitShortDateCB(hwndDlg, pGlobalData);
562  InitLongDateCB(hwndDlg, pGlobalData);
563  InitShortDateSepSamples(hwndDlg, pGlobalData);
564  /* TODO: Add other calendar types */
565  pGlobalData->bEnableYearNotification = TRUE;
566  break;
567 
568  case WM_COMMAND:
569  switch (LOWORD(wParam))
570  {
571  case IDC_SECONDYEAR_EDIT:
572  if (HIWORD(wParam) == EN_CHANGE &&
573  pGlobalData != NULL &&
574  pGlobalData->bEnableYearNotification == TRUE)
575  {
576  SetMinDate(hwndDlg);
577 
578  /* Enable the Apply button */
579  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
580  }
581  break;
582 
583  case IDC_CALTYPE_COMBO:
584  case IDC_HIJCHRON_COMBO:
588  if (HIWORD(wParam) == CBN_SELCHANGE ||
590  {
591  /* Enable the Apply button */
592  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
593  }
594  break;
595  }
596  break;
597 
598  case WM_NOTIFY:
599  if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
600  {
601  if (GetDateSetting(hwndDlg, pGlobalData))
602  {
603  pGlobalData->bUserLocaleChanged = TRUE;
604  SetMaxDate(hwndDlg, pGlobalData->UserLCID);
605  UpdateDateLocaleSamples(hwndDlg, pGlobalData);
606  }
607  }
608  break;
609  }
610 
611  return FALSE;
612 }
613 
614 /* EOF */
#define EM_LIMITTEXT
Definition: winuser.h:1982
#define IDC_LONGDATEFMT_COMBO
Definition: resource.h:65
static VOID InitShortDateSepSamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:236
static VOID InitMinMaxDateSpin(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:449
struct _GLOBALDATA * PGLOBALDATA
const uint16_t * PCWSTR
Definition: typedefs.h:55
PWSTR ReplaceSubStr(PCWSTR szSourceStr, PCWSTR szStrToReplace, PCWSTR szTempl)
Definition: misc.c:118
#define IDC_LONGDATESAMPLE_EDIT
Definition: resource.h:63
#define TRUE
Definition: types.h:120
#define UDM_GETPOS
Definition: commctrl.h:2140
#define IDS_ERROR_SYMBOL_SEPARATE
Definition: resource.h:87
uint16_t * PWSTR
Definition: typedefs.h:54
#define MAX_YEAR
Definition: date.c:35
#define DATE_SHORTDATE
Definition: winnls.h:193
#define WM_GETTEXT
Definition: winuser.h:1600
#define CALLBACK
Definition: compat.h:27
static VOID UpdateDateLocaleSamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:496
static BOOL SetShortDateSep(HWND hwndDlg, PWSTR pszShortDateSep)
Definition: date.c:90
DWORD LCID
Definition: nls.h:13
UINT_PTR WPARAM
Definition: windef.h:207
_CRTIMP wchar_t *__cdecl _itow(_In_ int _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_SCR_MAX_YEAR
Definition: resource.h:56
int32_t INT_PTR
Definition: typedefs.h:62
#define IDC_SHRTDATESAMPLE_EDIT
Definition: resource.h:59
#define IDC_FIRSTYEAR_EDIT
Definition: resource.h:54
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define YEAR_DIFF
Definition: date.c:34
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define MAX_SHORTDATEFORMAT
Definition: intl.h:43
#define IDS_ERROR_SYMBOL_FORMAT_SHORT
Definition: resource.h:88
unsigned int BOOL
Definition: ntddk_ex.h:94
#define iswalnum(_c)
Definition: ctype.h:671
static BOOL CALLBACK ShortDateFormatEnumProc(PWSTR lpTimeFormatString)
Definition: date.c:283
#define CB_ADDSTRING
Definition: winuser.h:1918
#define MAKELONG(a, b)
Definition: typedefs.h:248
static BOOL SetLongDateFormat(HWND hwndDlg, PWSTR pszLongDateFmt)
Definition: date.c:193
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR szDateSep[MAX_DATESEPARATOR]
Definition: intl.h:101
#define UDM_SETRANGE
Definition: commctrl.h:2137
#define CB_LIMITTEXT
Definition: winuser.h:1940
#define WM_SETTEXT
Definition: winuser.h:1599
#define CB_RESETCONTENT
Definition: winuser.h:1941
#define CB_ERR
Definition: winuser.h:2410
static BOOL GetDateSetting(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:519
static VOID SetMaxDate(HWND hwndDlg, LCID lcid)
Definition: date.c:383
#define MAX_SAMPLES_STR_SIZE
Definition: intl.h:24
WCHAR szLongDateFormat[MAX_LONGDATEFORMAT]
Definition: intl.h:99
BOOL WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW proc, LCID lcid, DWORD flags)
Definition: lcformat.c:2017
#define MAX_SHRT_DATE_SEPARATORS
Definition: date.c:32
#define GetProcessHeap()
Definition: compat.h:403
#define CBN_EDITCHANGE
Definition: winuser.h:1957
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int WINAPI SetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType, LPCWSTR lpCalData)
Definition: lcformat.c:2826
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define MAX_DATESEPARATOR
Definition: intl.h:45
#define CAL_GREGORIAN
Definition: winnls.h:440
#define YEAR_STR_MAX_SIZE
Definition: date.c:31
unsigned long DWORD
Definition: ntddk_ex.h:95
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HWND hwndEnum
Definition: date.c:37
#define STD_DATE_SEP
Definition: date.c:33
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
#define CB_SELECTSTRING
Definition: winuser.h:1942
#define DECIMAL_RADIX
Definition: intl.h:19
#define WM_COMMAND
Definition: winuser.h:1722
BOOL isDateCompAl(WCHAR alpha)
Definition: date.c:43
VOID InitShortDateCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:295
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
HWND WINAPI GetParent(_In_ HWND)
LPTSTR FindDateSep(const WCHAR *szSourceStr)
Definition: date.c:53
static BOOL SetShortDateFormat(HWND hwndDlg, PWSTR pszShortDateFmt)
Definition: date.c:125
WCHAR szShortDateFormat[MAX_SHORTDATEFORMAT]
Definition: intl.h:100
INT_PTR CALLBACK DatePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: date.c:544
#define IDC_SHRTDATEFMT_COMBO
Definition: resource.h:61
#define MAX_YEAR_EDIT
Definition: intl.h:46
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DATE_LONGDATE
Definition: winnls.h:194
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define UDM_SETPOS
Definition: commctrl.h:2139
unsigned int UINT
Definition: ndis.h:50
#define CBN_SELCHANGE
Definition: winuser.h:1961
static VOID SetMinDate(HWND hwndDlg)
Definition: date.c:425
static VOID InitLongDateCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:341
#define IDC_SECONDYEAR_EDIT
Definition: resource.h:55
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
uint32_t * LPDWORD
Definition: typedefs.h:57
#define HIWORD(l)
Definition: typedefs.h:246
#define IDC_SHRTDATESEP_COMBO
Definition: resource.h:62
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDC_CALTYPE_COMBO
Definition: resource.h:57
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define wsprintf
Definition: winuser.h:5766
#define IDC_HIJCHRON_COMBO
Definition: resource.h:58
VOID PrintErrorMsgBox(UINT msg)
Definition: intl.c:52
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static INT GetMaxDate(LCID lcid)
Definition: date.c:409
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:402
#define WM_NOTIFY
Definition: richedit.h:61
#define MAX_LONGDATEFORMAT
Definition: intl.h:44
#define IDS_ERROR_SYMBOL_FORMAT_LONG
Definition: resource.h:89
int WINAPI GetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType, LPWSTR lpCalData, int cchData, LPDWORD lpValue)
Definition: lcformat.c:2483
LCID UserLCID
Definition: intl.h:113
#define EN_CHANGE
Definition: winuser.h:2004