Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # if defined(_WIN32_WINNT_VISTA) && WINVER >= _WIN32_WINNT_VISTA && defined(LOCALE_NAME_USER_DEFAULT)
- GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, wsDay, 4)
- # else
- GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, wsDay, 4)
- # endif
- #include <stdio.h>
- #include <windows.h>
- int main(
- )
- {
- int ret;
- int first_weekday;
- DWORD week_1stday;
- ret = GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT,
- LOCALE_IFIRSTDAYOFWEEK | LOCALE_RETURN_NUMBER,
- (LPWSTR) & week_1stday,
- sizeof(week_1stday) / sizeof(WCHAR));
- /* 0:Monday, ..., 6:Sunday. */
- /* We need 1 for Monday, 0 for Sunday. */
- first_weekday = (week_1stday + 1) % 7;
- printf("ret = %dn", ret);
- printf("sizeof(ret) = %Iun", sizeof(ret));
- printf("sizeof(week_1stday) = %Iun", sizeof(week_1stday));
- printf("sizeof(WCHAR) = %Iun", sizeof(WCHAR));
- printf("week_1stday = %lun", week_1stday);
- printf("first_weekday = %dn", first_weekday);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement