Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. # if defined(_WIN32_WINNT_VISTA) && WINVER >= _WIN32_WINNT_VISTA && defined(LOCALE_NAME_USER_DEFAULT)
  2. GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, wsDay, 4)
  3. # else
  4. GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, wsDay, 4)
  5. # endif
  6.  
  7. #include <stdio.h>
  8. #include <windows.h>
  9.  
  10. int main(
  11. )
  12. {
  13. int ret;
  14. int first_weekday;
  15. DWORD week_1stday;
  16.  
  17. ret = GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT,
  18. LOCALE_IFIRSTDAYOFWEEK | LOCALE_RETURN_NUMBER,
  19. (LPWSTR) & week_1stday,
  20. sizeof(week_1stday) / sizeof(WCHAR));
  21. /* 0:Monday, ..., 6:Sunday. */
  22. /* We need 1 for Monday, 0 for Sunday. */
  23. first_weekday = (week_1stday + 1) % 7;
  24. printf("ret = %dn", ret);
  25. printf("sizeof(ret) = %Iun", sizeof(ret));
  26. printf("sizeof(week_1stday) = %Iun", sizeof(week_1stday));
  27. printf("sizeof(WCHAR) = %Iun", sizeof(WCHAR));
  28. printf("week_1stday = %lun", week_1stday);
  29. printf("first_weekday = %dn", first_weekday);
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement