Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB

  1. #include "windows.h"
  2. #include <port1632.h>
  3. #include "date.h"
  4. extern CHAR chSepDate;
  5. extern CHAR chSepTime;
  6. extern CHAR sz1159[];
  7. extern CHAR sz2359[];
  8. extern INT iDate;
  9. extern INT iYearOffset;
  10. extern BOOL f24Time;
  11. extern BOOL fLZero;
  12. extern HANDLE hinstTimeDate;
  13. extern INT cchTimeMax;
  14. extern INT cchLongDateMax;
  15. extern CHAR *rgszDayAbbrevs[];
  16. BOOL FAR APIENTRY InitTimeDate (HANDLE hInstance, UINT format)
  17. {
  18. static CHAR szIntl[] = "intl";
  19. CHAR rgch[2];
  20. hinstTimeDate = hInstance;
  21. iDate = GetProfileInt((LPSTR)szIntl, (LPSTR)"iDate", 0);
  22. if (format & GTS_24HOUR)
  23. f24Time = TRUE;
  24. else if (format & GTS_12HOUR)
  25. f24Time = FALSE;
  26. else
  27. f24Time = GetProfileInt((LPSTR)szIntl, (LPSTR)"iTime", 0);
  28. if (format & GTS_LEADINGZEROS)
  29. fLZero = TRUE;
  30. else
  31. fLZero = GetProfileInt((LPSTR)szIntl, (LPSTR)"iLzero", 0);
  32. iYearOffset = GetProfileInt((LPSTR)szIntl, (LPSTR)"iYearOffset", 0);
  33. GetProfileString((LPSTR)szIntl, (LPSTR)"s1159", (LPSTR)sz1159,
  34. (LPSTR)sz1159, 9);
  35. GetProfileString((LPSTR)szIntl, (LPSTR)"s2359", (LPSTR)sz2359,
  36. (LPSTR)sz2359, 9);
  37. GetProfileString((LPSTR)szIntl, (LPSTR)"sDate", (LPSTR)"/", (LPSTR)rgch, 2);
  38. chSepDate = rgch[0];
  39. GetProfileString((LPSTR)szIntl, (LPSTR)"sTime", (LPSTR)":", (LPSTR)rgch, 2);
  40. chSepTime = rgch[0];
  41. return TRUE;
  42. }