ReactOS 0.4.15-dev-7958-gcd0bb1a
generalp.c
Go to the documentation of this file.
1/*
2 * ReactOS
3 * Copyright (C) 2004, 2005 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/generalp.c
22 * PURPOSE: General property page
23 * PROGRAMMER: Eric Kohl
24 * Klemens Friedl
25 * Aleksey Bragin
26 */
27
28#include "intl.h"
29
30#include <debug.h>
31
32#define SAMPLE_NUMBER L"123456789"
33
34#define NUM_SHEETS 4
35
36#define MAX_FIELD_DIG_SAMPLES 3
37
38
42
45{
46 {0, L"0;0"},
47 {3, L"3;0"},
48 {32, L"3;2;0"}
49};
50
51static BOOL CALLBACK
53{
54 LCID lcid;
55 WCHAR lang[255];
56 INT index;
57 BOOL bNoShow = FALSE;
58
59 lcid = wcstoul(lpLocale, NULL, 16);
60
61 /* Display only languages with installed support */
62 if (!IsValidLocale(lcid, LCID_INSTALLED))
63 return TRUE;
64
67 {
68 if (isSpain == FALSE)
69 {
71 isSpain = TRUE;
72 }
73 else
74 {
75 bNoShow = TRUE;
76 }
77 }
78 else
79 {
80 GetLocaleInfoW(lcid, LOCALE_SLANGUAGE, lang, sizeof(lang)/sizeof(WCHAR));
81 }
82
83 if (bNoShow == FALSE)
84 {
87 0,
88 (LPARAM)lang);
89
92 index,
93 (LPARAM)lcid);
94 }
95
96 return TRUE;
97}
98
99
100/* Update all locale samples */
101static
102VOID
104 HWND hwndDlg,
105 PGLOBALDATA pGlobalData)
106{
108 NUMBERFMT NumberFormat;
109 CURRENCYFMTW CurrencyFormat;
110
111 NumberFormat.NumDigits = pGlobalData->nNumDigits;
112 NumberFormat.LeadingZero = pGlobalData->nNumLeadingZero;
113 NumberFormat.Grouping = GroupingFormats[pGlobalData->nNumGrouping].nInteger;
114 NumberFormat.lpDecimalSep = pGlobalData->szNumDecimalSep;
115 NumberFormat.lpThousandSep = pGlobalData->szNumThousandSep;
116 NumberFormat.NegativeOrder = pGlobalData->nNumNegFormat;
117
118 CurrencyFormat.NumDigits = pGlobalData->nCurrDigits;
119 CurrencyFormat.LeadingZero = pGlobalData->nNumLeadingZero;
120 CurrencyFormat.Grouping = GroupingFormats[pGlobalData->nCurrGrouping].nInteger;
121 CurrencyFormat.lpDecimalSep = pGlobalData->szCurrDecimalSep;
122 CurrencyFormat.lpThousandSep = pGlobalData->szCurrThousandSep;
123 CurrencyFormat.NegativeOrder = pGlobalData->nCurrNegFormat;
124 CurrencyFormat.PositiveOrder = pGlobalData->nCurrPosFormat;
125 CurrencyFormat.lpCurrencySymbol = pGlobalData->szCurrSymbol;
126
127 /* Get number format sample */
128 GetNumberFormatW(pGlobalData->UserLCID, 0, SAMPLE_NUMBER,
129 &NumberFormat,
134
135 /* Get monetary format sample */
137 &CurrencyFormat,
142
143 /* Get time format sample */
144 GetTimeFormatW(pGlobalData->UserLCID, 0, NULL,
145 pGlobalData->szTimeFormat,
150
151 /* Get short date format sample */
152 GetDateFormatW(pGlobalData->UserLCID, 0, NULL,
153 pGlobalData->szShortDateFormat,
157
158 /* Get long date sample */
159 GetDateFormatW(pGlobalData->UserLCID, 0, NULL,
160 pGlobalData->szLongDateFormat,
164}
165
166static VOID
168{
169 WCHAR langSel[255];
170
171 hList = hwnd;
172 isSpain = FALSE;
174
175 /* Select current locale */
176 /* or should it be System and not user? */
178
181 -1,
182 (LPARAM)langSel);
183}
184
185
186BOOL
188 PGLOBALDATA pGlobalData)
189{
190 WCHAR szBuffer[16];
191 PWSTR ptr;
192 HKEY hLocaleKey;
193 DWORD ret;
195
197 L"Control Panel\\International",
198 0,
199 KEY_READ,
200 &hLocaleKey);
201 if (ret != ERROR_SUCCESS)
202 {
204 return FALSE;
205 }
206
207 dwSize = 9 * sizeof(WCHAR);
208 RegQueryValueExW(hLocaleKey,
209 L"Locale",
210 NULL,
211 NULL,
212 (PBYTE)szBuffer,
213 &dwSize);
214 pGlobalData->UserLCID = (LCID)wcstoul(szBuffer, &ptr, 16);
215
216 /* Number */
217 dwSize = MAX_NUMDECIMALSEP * sizeof(WCHAR);
218 RegQueryValueExW(hLocaleKey,
219 L"sDecimal",
220 NULL,
221 NULL,
222 (PBYTE)pGlobalData->szNumDecimalSep,
223 &dwSize);
224
225 dwSize = MAX_NUMTHOUSANDSEP * sizeof(WCHAR);
226 RegQueryValueExW(hLocaleKey,
227 L"sThousand",
228 NULL,
229 NULL,
230 (PBYTE)pGlobalData->szNumThousandSep,
231 &dwSize);
232
233 dwSize = MAX_NUMNEGATIVESIGN * sizeof(WCHAR);
234 RegQueryValueExW(hLocaleKey,
235 L"sNegativeSign",
236 NULL,
237 NULL,
238 (PBYTE)pGlobalData->szNumNegativeSign,
239 &dwSize);
240
241 dwSize = MAX_NUMPOSITIVESIGN * sizeof(WCHAR);
242 RegQueryValueExW(hLocaleKey,
243 L"sPositiveSign",
244 NULL,
245 NULL,
246 (PBYTE)pGlobalData->szNumPositiveSign,
247 &dwSize);
248
249 dwSize = MAX_NUMLISTSEP * sizeof(WCHAR);
250 RegQueryValueExW(hLocaleKey,
251 L"sList",
252 NULL,
253 NULL,
254 (PBYTE)pGlobalData->szNumListSep,
255 &dwSize);
256
257 dwSize = MAX_NUMNATIVEDIGITS * sizeof(WCHAR);
258 RegQueryValueExW(hLocaleKey,
259 L"sNativeDigits",
260 NULL,
261 NULL,
262 (PBYTE)pGlobalData->szNumNativeDigits,
263 &dwSize);
264
265 pGlobalData->nNumNegFormat = 0;
266 dwSize = 16 * sizeof(WCHAR);
267 if (RegQueryValueExW(hLocaleKey,
268 L"iNegNumber",
269 NULL,
270 NULL,
271 (PBYTE)szBuffer,
273 pGlobalData->nNumNegFormat = _wtoi(szBuffer);
274
275 pGlobalData->nNumDigits = 0;
276 dwSize = 16 * sizeof(WCHAR);
277 if (RegQueryValueExW(hLocaleKey,
278 L"iDigits",
279 NULL,
280 NULL,
281 (PBYTE)szBuffer,
283 pGlobalData->nNumDigits = _wtoi(szBuffer);
284
285 pGlobalData->nNumLeadingZero = 0;
286 dwSize = 16 * sizeof(WCHAR);
287 if (RegQueryValueExW(hLocaleKey,
288 L"iLZero",
289 NULL,
290 NULL,
291 (PBYTE)szBuffer,
293 pGlobalData->nNumLeadingZero = _wtoi(szBuffer);
294
295 pGlobalData->nNumMeasure = 0;
296 dwSize = 16 * sizeof(WCHAR);
297 if (RegQueryValueExW(hLocaleKey,
298 L"iMeasure",
299 NULL,
300 NULL,
301 (PBYTE)szBuffer,
303 pGlobalData->nNumMeasure = _wtoi(szBuffer);
304
305 pGlobalData->nNumShape = 0;
306 dwSize = 16 * sizeof(WCHAR);
307 if (RegQueryValueExW(hLocaleKey,
308 L"NumShape",
309 NULL,
310 NULL,
311 (PBYTE)szBuffer,
313 pGlobalData->nNumShape = _wtoi(szBuffer);
314
315 pGlobalData->nNumGrouping = 0;
316 dwSize = 16 * sizeof(WCHAR);
317 if (RegQueryValueExW(hLocaleKey,
318 L"sGrouping",
319 NULL,
320 NULL,
321 (PBYTE)szBuffer,
323 {
324 pGlobalData->nNumGrouping = 0;
325 if (szBuffer[0] == L'3')
326 {
327 if ((szBuffer[1] == L';') &&
328 (szBuffer[2] == L'2'))
329 pGlobalData->nNumGrouping = 2;
330 else
331 pGlobalData->nNumGrouping = 1;
332 }
333 }
334
335 /* Currency */
336 dwSize = MAX_CURRSYMBOL * sizeof(WCHAR);
337 RegQueryValueExW(hLocaleKey,
338 L"sCurrency",
339 NULL,
340 NULL,
341 (PBYTE)pGlobalData->szCurrSymbol,
342 &dwSize);
343
344 dwSize = MAX_CURRDECIMALSEP * sizeof(WCHAR);
345 RegQueryValueExW(hLocaleKey,
346 L"sMonDecimalSep",
347 NULL,
348 NULL,
349 (PBYTE)pGlobalData->szCurrDecimalSep,
350 &dwSize);
351
352 dwSize = MAX_CURRTHOUSANDSEP * sizeof(WCHAR);
353 RegQueryValueExW(hLocaleKey,
354 L"sMonThousandSep",
355 NULL,
356 NULL,
357 (PBYTE)pGlobalData->szCurrThousandSep,
358 &dwSize);
359
360 pGlobalData->nCurrGrouping = 0;
361 dwSize = 16 * sizeof(WCHAR);
362 if (RegQueryValueExW(hLocaleKey,
363 L"sMonGrouping",
364 NULL,
365 NULL,
366 (PBYTE)szBuffer,
368 {
369 pGlobalData->nCurrGrouping = 0;
370 if (szBuffer[0] == L'3')
371 {
372 if ((szBuffer[1] == L';') &&
373 (szBuffer[2] == L'2'))
374 pGlobalData->nCurrGrouping = 2;
375 else
376 pGlobalData->nCurrGrouping = 1;
377 }
378 }
379
380 pGlobalData->nCurrPosFormat = 0;
381 dwSize = 16 * sizeof(WCHAR);
382 if (RegQueryValueExW(hLocaleKey,
383 L"iCurrency",
384 NULL,
385 NULL,
386 (PBYTE)szBuffer,
388 pGlobalData->nCurrPosFormat = _wtoi(szBuffer);
389
390 pGlobalData->nCurrNegFormat = 0;
391 dwSize = 16 * sizeof(WCHAR);
392 if (RegQueryValueExW(hLocaleKey,
393 L"iNegCurr",
394 NULL,
395 NULL,
396 (PBYTE)szBuffer,
398 pGlobalData->nCurrNegFormat = _wtoi(szBuffer);
399
400 pGlobalData->nCurrDigits = 0;
401 dwSize = 16 * sizeof(WCHAR);
402 if (RegQueryValueExW(hLocaleKey,
403 L"iCurrDigits",
404 NULL,
405 NULL,
406 (PBYTE)szBuffer,
408 pGlobalData->nCurrDigits = _wtoi(szBuffer);
409
410 /* Time */
411 dwSize = MAX_TIMEFORMAT * sizeof(WCHAR);
412 RegQueryValueExW(hLocaleKey,
413 L"sTimeFormat",
414 NULL,
415 NULL,
416 (PBYTE)pGlobalData->szTimeFormat,
417 &dwSize);
418
419 dwSize = MAX_TIMESEPARATOR * sizeof(WCHAR);
420 RegQueryValueExW(hLocaleKey,
421 L"sTime",
422 NULL,
423 NULL,
424 (PBYTE)pGlobalData->szTimeSep,
425 &dwSize);
426
427 dwSize = MAX_TIMEAMSYMBOL * sizeof(WCHAR);
428 RegQueryValueExW(hLocaleKey,
429 L"s1159",
430 NULL,
431 NULL,
432 (PBYTE)pGlobalData->szTimeAM,
433 &dwSize);
434
435 dwSize = MAX_TIMEPMSYMBOL * sizeof(WCHAR);
436 RegQueryValueExW(hLocaleKey,
437 L"s2359",
438 NULL,
439 NULL,
440 (PBYTE)pGlobalData->szTimePM,
441 &dwSize);
442
443 pGlobalData->nTime = 0;
444 dwSize = 16 * sizeof(WCHAR);
445 if (RegQueryValueExW(hLocaleKey,
446 L"iTime",
447 NULL,
448 NULL,
449 (PBYTE)szBuffer,
451 pGlobalData->nTime = _wtoi(szBuffer);
452
453 pGlobalData->nTimePrefix = 0;
454 dwSize = 16 * sizeof(WCHAR);
455 if (RegQueryValueExW(hLocaleKey,
456 L"iTimePrefix",
457 NULL,
458 NULL,
459 (PBYTE)szBuffer,
461 pGlobalData->nTimePrefix = _wtoi(szBuffer);
462
463 pGlobalData->nTimeLeadingZero = 0;
464 dwSize = 16 * sizeof(WCHAR);
465 if (RegQueryValueExW(hLocaleKey,
466 L"iTLZero",
467 NULL,
468 NULL,
469 (PBYTE)szBuffer,
471 pGlobalData->nTimeLeadingZero = _wtoi(szBuffer);
472
473 /* Date */
474 dwSize = MAX_LONGDATEFORMAT * sizeof(WCHAR);
475 RegQueryValueExW(hLocaleKey,
476 L"sLongDate",
477 NULL,
478 NULL,
479 (PBYTE)pGlobalData->szLongDateFormat,
480 &dwSize);
481
482 dwSize = MAX_SHORTDATEFORMAT * sizeof(WCHAR);
483 RegQueryValueExW(hLocaleKey,
484 L"sShortDate",
485 NULL,
486 NULL,
487 (PBYTE)pGlobalData->szShortDateFormat,
488 &dwSize);
489
490 dwSize = MAX_DATESEPARATOR * sizeof(WCHAR);
491 RegQueryValueExW(hLocaleKey,
492 L"sDate",
493 NULL,
494 NULL,
495 (PBYTE)pGlobalData->szDateSep,
496 &dwSize);
497
498 pGlobalData->nFirstDayOfWeek = 0;
499 dwSize = 16 * sizeof(WCHAR);
500 if (RegQueryValueExW(hLocaleKey,
501 L"iFirstDayOfWeek",
502 NULL,
503 NULL,
504 (PBYTE)szBuffer,
506 pGlobalData->nFirstDayOfWeek = _wtoi(szBuffer);
507
508 pGlobalData->nFirstWeekOfYear = 0;
509 dwSize = 16 * sizeof(WCHAR);
510 if (RegQueryValueExW(hLocaleKey,
511 L"iFirstWeekOfYear",
512 NULL,
513 NULL,
514 (PBYTE)szBuffer,
516 pGlobalData->nFirstWeekOfYear = _wtoi(szBuffer);
517
518 pGlobalData->nDate = 0;
519 dwSize = 16 * sizeof(WCHAR);
520 if (RegQueryValueExW(hLocaleKey,
521 L"iDate",
522 NULL,
523 NULL,
524 (PBYTE)szBuffer,
526 pGlobalData->nDate = _wtoi(szBuffer);
527
528 pGlobalData->nCalendarType = 0;
529 dwSize = 16 * sizeof(WCHAR);
530 if (RegQueryValueExW(hLocaleKey,
531 L"iCalendarType",
532 NULL,
533 NULL,
534 (PBYTE)szBuffer,
536 pGlobalData->nCalendarType = _wtoi(szBuffer);
537
538 /* Misc */
539 dwSize = MAX_MISCCOUNTRY * sizeof(WCHAR);
540 RegQueryValueExW(hLocaleKey,
541 L"sCountry",
542 NULL,
543 NULL,
544 (PBYTE)pGlobalData->szMiscCountry,
545 &dwSize);
546
547 dwSize = MAX_MISCLANGUAGE * sizeof(WCHAR);
548 RegQueryValueExW(hLocaleKey,
549 L"sLanguage",
550 NULL,
551 NULL,
552 (PBYTE)pGlobalData->szMiscLanguage,
553 &dwSize);
554
555 pGlobalData->nMiscCountry = 0;
556 dwSize = 16 * sizeof(WCHAR);
557 if (RegQueryValueExW(hLocaleKey,
558 L"iCountry",
559 NULL,
560 NULL,
561 (PBYTE)szBuffer,
563 pGlobalData->nMiscCountry = _wtoi(szBuffer);
564
565 RegCloseKey(hLocaleKey);
566
567 return TRUE;
568}
569
570
571VOID
573 PGLOBALDATA pGlobalData,
574 LCID lcid)
575{
576 WCHAR szBuffer[16];
577
578 pGlobalData->UserLCID = lcid;
579
580 /* Number */
581 GetLocaleInfo(lcid,
583 pGlobalData->szNumDecimalSep,
585
586 GetLocaleInfo(lcid,
588 pGlobalData->szNumThousandSep,
590
591 GetLocaleInfo(lcid,
593 pGlobalData->szNumNegativeSign,
595
596 GetLocaleInfo(lcid,
598 pGlobalData->szNumPositiveSign,
600
601 GetLocaleInfo(lcid,
603 pGlobalData->szNumListSep,
605
606 GetLocaleInfo(lcid,
608 pGlobalData->szNumNativeDigits,
610
611 GetLocaleInfo(lcid,
613 szBuffer,
614 sizeof(szBuffer) / sizeof(WCHAR));
615 pGlobalData->nNumNegFormat = _wtoi(szBuffer);
616
617 GetLocaleInfo(lcid,
619 szBuffer,
620 sizeof(szBuffer) / sizeof(WCHAR));
621 pGlobalData->nNumDigits = _wtoi(szBuffer);
622
623 GetLocaleInfo(lcid,
625 szBuffer,
626 sizeof(szBuffer) / sizeof(WCHAR));
627 pGlobalData->nNumLeadingZero = _wtoi(szBuffer);
628
629 GetLocaleInfo(lcid,
631 szBuffer,
632 sizeof(szBuffer) / sizeof(WCHAR));
633 pGlobalData->nNumMeasure = _wtoi(szBuffer);
634
635 GetLocaleInfo(lcid,
636 LOCALE_IDIGITSUBSTITUTION | LOCALE_NOUSEROVERRIDE,
637 szBuffer,
638 sizeof(szBuffer) / sizeof(WCHAR));
639 pGlobalData->nNumShape = _wtoi(szBuffer);
640
641 GetLocaleInfo(lcid,
643 szBuffer,
644 sizeof(szBuffer) / sizeof(WCHAR));
645 pGlobalData->nNumGrouping = 0;
646 if (szBuffer[0] == L'3')
647 {
648 if ((szBuffer[1] == L';') &&
649 (szBuffer[2] == L'2'))
650 pGlobalData->nNumGrouping = 2;
651 else
652 pGlobalData->nNumGrouping = 1;
653 }
654
655 /* Currency */
656 GetLocaleInfo(lcid,
658 pGlobalData->szCurrSymbol,
660
661 GetLocaleInfo(lcid,
663 pGlobalData->szCurrDecimalSep,
665
666 GetLocaleInfo(lcid,
668 pGlobalData->szCurrThousandSep,
670
671 GetLocaleInfo(lcid,
673 szBuffer,
674 sizeof(szBuffer) / sizeof(WCHAR));
675 pGlobalData->nCurrGrouping = 0;
676 if (szBuffer[0] == L'3')
677 {
678 if ((szBuffer[1] == L';') &&
679 (szBuffer[2] == L'2'))
680 pGlobalData->nCurrGrouping = 2;
681 else
682 pGlobalData->nCurrGrouping = 1;
683 }
684
685 GetLocaleInfo(lcid,
687 szBuffer,
688 sizeof(szBuffer) / sizeof(WCHAR));
689 pGlobalData->nCurrPosFormat = _wtoi(szBuffer);
690
691 GetLocaleInfo(lcid,
693 szBuffer,
694 sizeof(szBuffer) / sizeof(WCHAR));
695 pGlobalData->nCurrNegFormat = _wtoi(szBuffer);
696
697 GetLocaleInfo(lcid,
699 szBuffer,
700 sizeof(szBuffer) / sizeof(WCHAR));
701 pGlobalData->nCurrDigits = _wtoi(szBuffer);
702
703 /* Time */
704 GetLocaleInfo(lcid,
706 pGlobalData->szTimeFormat,
708
709 GetLocaleInfo(lcid,
711 pGlobalData->szTimeSep,
713
714 GetLocaleInfo(lcid,
716 pGlobalData->szTimeAM,
718
719 GetLocaleInfo(lcid,
721 pGlobalData->szTimePM,
723
724 GetLocaleInfo(lcid,
726 szBuffer,
727 sizeof(szBuffer) / sizeof(WCHAR));
728 pGlobalData->nTime = _wtoi(szBuffer);
729
730 GetLocaleInfo(lcid,
732 szBuffer,
733 sizeof(szBuffer) / sizeof(WCHAR));
734 pGlobalData->nTimePrefix = _wtoi(szBuffer);
735
736 GetLocaleInfo(lcid,
738 szBuffer,
739 sizeof(szBuffer) / sizeof(WCHAR));
740 pGlobalData->nTimeLeadingZero = _wtoi(szBuffer);
741
742 /* Date */
743 GetLocaleInfo(lcid,
745 pGlobalData->szLongDateFormat,
747
748 GetLocaleInfo(lcid,
750 pGlobalData->szShortDateFormat,
752
753 GetLocaleInfo(lcid,
755 pGlobalData->szDateSep,
757
758 GetLocaleInfo(lcid,
760 szBuffer,
761 sizeof(szBuffer) / sizeof(WCHAR));
762 pGlobalData->nFirstDayOfWeek = _wtoi(szBuffer);
763
764 GetLocaleInfo(lcid,
766 szBuffer,
767 sizeof(szBuffer) / sizeof(WCHAR));
768 pGlobalData->nFirstWeekOfYear = _wtoi(szBuffer);
769
770 GetLocaleInfo(lcid,
772 szBuffer,
773 sizeof(szBuffer) / sizeof(WCHAR));
774 pGlobalData->nDate = _wtoi(szBuffer);
775
776 GetLocaleInfo(lcid,
778 szBuffer,
779 sizeof(szBuffer) / sizeof(WCHAR));
780 pGlobalData->nCalendarType = _wtoi(szBuffer);
781
782 /* Misc */
783 GetLocaleInfo(lcid,
785 pGlobalData->szMiscCountry,
787
788 GetLocaleInfo(lcid,
790 pGlobalData->szMiscLanguage,
792
793 GetLocaleInfo(lcid,
795 szBuffer,
796 sizeof(szBuffer) / sizeof(WCHAR));
797 pGlobalData->nMiscCountry = _wtoi(szBuffer);
798}
799
800
801static
802VOID
804 PGLOBALDATA pGlobalData,
805 HKEY hLocaleKey)
806{
807 WCHAR szBuffer[16];
808
809 wsprintf(szBuffer, L"%08lx", (DWORD)pGlobalData->UserLCID);
810 RegSetValueExW(hLocaleKey,
811 L"Locale",
812 0,
813 REG_SZ,
814 (PBYTE)szBuffer,
815 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
816
817 /* Number */
818 RegSetValueExW(hLocaleKey,
819 L"sDecimal",
820 0,
821 REG_SZ,
822 (PBYTE)pGlobalData->szNumDecimalSep,
823 (wcslen(pGlobalData->szNumDecimalSep) + 1) * sizeof(WCHAR));
824
825 RegSetValueExW(hLocaleKey,
826 L"sThousand",
827 0,
828 REG_SZ,
829 (PBYTE)pGlobalData->szNumThousandSep,
830 (wcslen(pGlobalData->szNumThousandSep) + 1) * sizeof(WCHAR));
831
832 RegSetValueExW(hLocaleKey,
833 L"sNegativeSign",
834 0,
835 REG_SZ,
836 (PBYTE)pGlobalData->szNumNegativeSign,
837 (wcslen(pGlobalData->szNumNegativeSign) + 1) * sizeof(WCHAR));
838
839 RegSetValueExW(hLocaleKey,
840 L"sPositiveSign",
841 0,
842 REG_SZ,
843 (PBYTE)pGlobalData->szNumPositiveSign,
844 (wcslen(pGlobalData->szNumPositiveSign) + 1) * sizeof(WCHAR));
845
846 RegSetValueExW(hLocaleKey,
847 L"sGrouping",
848 0,
849 REG_SZ,
851 (wcslen(GroupingFormats[pGlobalData->nNumGrouping].pszString) + 1) * sizeof(WCHAR));
852
853 RegSetValueExW(hLocaleKey,
854 L"sList",
855 0,
856 REG_SZ,
857 (PBYTE)pGlobalData->szNumListSep,
858 (wcslen(pGlobalData->szNumListSep) + 1) * sizeof(WCHAR));
859
860 RegSetValueExW(hLocaleKey,
861 L"sNativeDigits",
862 0,
863 REG_SZ,
864 (PBYTE)pGlobalData->szNumNativeDigits,
865 (wcslen(pGlobalData->szNumNativeDigits) + 1) * sizeof(WCHAR));
866
867 _itow(pGlobalData->nNumNegFormat,
868 szBuffer, DECIMAL_RADIX);
869 RegSetValueExW(hLocaleKey,
870 L"iNegNumber",
871 0,
872 REG_SZ,
873 (PBYTE)szBuffer,
874 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
875
876 _itow(pGlobalData->nNumDigits,
877 szBuffer, DECIMAL_RADIX);
878 RegSetValueExW(hLocaleKey,
879 L"iDigits",
880 0,
881 REG_SZ,
882 (PBYTE)szBuffer,
883 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
884
885 _itow(pGlobalData->nNumLeadingZero,
886 szBuffer, DECIMAL_RADIX);
887 RegSetValueExW(hLocaleKey,
888 L"iLZero",
889 0,
890 REG_SZ,
891 (PBYTE)szBuffer,
892 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
893
894 _itow(pGlobalData->nNumMeasure,
895 szBuffer, DECIMAL_RADIX);
896 RegSetValueExW(hLocaleKey,
897 L"iMeasure",
898 0,
899 REG_SZ,
900 (PBYTE)szBuffer,
901 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
902
903 _itow(pGlobalData->nNumShape,
904 szBuffer, DECIMAL_RADIX);
905 RegSetValueExW(hLocaleKey,
906 L"NumShape",
907 0,
908 REG_SZ,
909 (PBYTE)szBuffer,
910 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
911
912 /* Currency */
913 RegSetValueExW(hLocaleKey,
914 L"sCurrency",
915 0,
916 REG_SZ,
917 (PBYTE)pGlobalData->szCurrSymbol,
918 (wcslen(pGlobalData->szCurrSymbol) + 1) * sizeof(WCHAR));
919
920 RegSetValueExW(hLocaleKey,
921 L"sMonDecimalSep",
922 0,
923 REG_SZ,
924 (PBYTE)pGlobalData->szCurrDecimalSep,
925 (wcslen(pGlobalData->szCurrDecimalSep) + 1) * sizeof(WCHAR));
926
927 RegSetValueExW(hLocaleKey,
928 L"sMonThousandSep",
929 0,
930 REG_SZ,
931 (PBYTE)pGlobalData->szCurrThousandSep,
932 (wcslen(pGlobalData->szCurrThousandSep) + 1) * sizeof(WCHAR));
933
934 RegSetValueExW(hLocaleKey,
935 L"sMonGrouping",
936 0,
937 REG_SZ,
939 (wcslen(GroupingFormats[pGlobalData->nCurrGrouping].pszString) + 1) * sizeof(WCHAR));
940
941 _itow(pGlobalData->nCurrPosFormat,
942 szBuffer, DECIMAL_RADIX);
943 RegSetValueExW(hLocaleKey,
944 L"iCurrency",
945 0,
946 REG_SZ,
947 (PBYTE)szBuffer,
948 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
949
950 _itow(pGlobalData->nCurrNegFormat,
951 szBuffer, DECIMAL_RADIX);
952 RegSetValueExW(hLocaleKey,
953 L"iNegCurr",
954 0,
955 REG_SZ,
956 (PBYTE)szBuffer,
957 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
958
959 _itow(pGlobalData->nCurrDigits,
960 szBuffer, DECIMAL_RADIX);
961 RegSetValueExW(hLocaleKey,
962 L"iCurrDigits",
963 0,
964 REG_SZ,
965 (PBYTE)szBuffer,
966 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
967
968 /* Time */
969 RegSetValueExW(hLocaleKey,
970 L"sTimeFormat",
971 0,
972 REG_SZ,
973 (PBYTE)pGlobalData->szTimeFormat,
974 (wcslen(pGlobalData->szTimeFormat) + 1) * sizeof(WCHAR));
975
976 RegSetValueExW(hLocaleKey,
977 L"sTime",
978 0,
979 REG_SZ,
980 (PBYTE)pGlobalData->szTimeSep,
981 (wcslen(pGlobalData->szTimeSep) + 1) * sizeof(WCHAR));
982
983 RegSetValueExW(hLocaleKey,
984 L"s1159",
985 0,
986 REG_SZ,
987 (PBYTE)pGlobalData->szTimeAM,
988 (wcslen(pGlobalData->szTimeAM) + 1) * sizeof(WCHAR));
989
990 RegSetValueExW(hLocaleKey,
991 L"s2359",
992 0,
993 REG_SZ,
994 (PBYTE)pGlobalData->szTimePM,
995 (wcslen(pGlobalData->szTimePM) + 1) * sizeof(WCHAR));
996
997 _itow(pGlobalData->nTime,
998 szBuffer, DECIMAL_RADIX);
999 RegSetValueExW(hLocaleKey,
1000 L"iTime",
1001 0,
1002 REG_SZ,
1003 (PBYTE)szBuffer,
1004 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1005
1006 _itow(pGlobalData->nTimePrefix,
1007 szBuffer, DECIMAL_RADIX);
1008 RegSetValueExW(hLocaleKey,
1009 L"iTimePrefix",
1010 0,
1011 REG_SZ,
1012 (PBYTE)szBuffer,
1013 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1014
1015 _itow(pGlobalData->nTimeLeadingZero,
1016 szBuffer, DECIMAL_RADIX);
1017 RegSetValueExW(hLocaleKey,
1018 L"iTLZero",
1019 0,
1020 REG_SZ,
1021 (PBYTE)szBuffer,
1022 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1023
1024 /* Date */
1025 RegSetValueExW(hLocaleKey,
1026 L"sLongDate",
1027 0,
1028 REG_SZ,
1029 (PBYTE)pGlobalData->szLongDateFormat,
1030 (wcslen(pGlobalData->szLongDateFormat) + 1) * sizeof(WCHAR));
1031
1032 RegSetValueExW(hLocaleKey,
1033 L"sShortDate",
1034 0,
1035 REG_SZ,
1036 (PBYTE)pGlobalData->szShortDateFormat,
1037 (wcslen(pGlobalData->szShortDateFormat) + 1) * sizeof(WCHAR));
1038
1039 RegSetValueExW(hLocaleKey,
1040 L"sDate",
1041 0,
1042 REG_SZ,
1043 (PBYTE)pGlobalData->szDateSep,
1044 (wcslen(pGlobalData->szDateSep) + 1) * sizeof(WCHAR));
1045
1046 _itow(pGlobalData->nFirstDayOfWeek,
1047 szBuffer, DECIMAL_RADIX);
1048 RegSetValueExW(hLocaleKey,
1049 L"iFirstDayOfWeek",
1050 0,
1051 REG_SZ,
1052 (PBYTE)szBuffer,
1053 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1054
1055 _itow(pGlobalData->nFirstWeekOfYear,
1056 szBuffer, DECIMAL_RADIX);
1057 RegSetValueExW(hLocaleKey,
1058 L"iFirstWeekOfYear",
1059 0,
1060 REG_SZ,
1061 (PBYTE)szBuffer,
1062 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1063
1064 _itow(pGlobalData->nDate,
1065 szBuffer, DECIMAL_RADIX);
1066 RegSetValueExW(hLocaleKey,
1067 L"iDate",
1068 0,
1069 REG_SZ,
1070 (PBYTE)szBuffer,
1071 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1072
1073 _itow(pGlobalData->nCalendarType,
1074 szBuffer, DECIMAL_RADIX);
1075 RegSetValueExW(hLocaleKey,
1076 L"iCalendarType",
1077 0,
1078 REG_SZ,
1079 (PBYTE)szBuffer,
1080 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1081
1082 /* Misc */
1083 RegSetValueExW(hLocaleKey,
1084 L"sCountry",
1085 0,
1086 REG_SZ,
1087 (PBYTE)pGlobalData->szMiscCountry,
1088 (wcslen(pGlobalData->szMiscCountry) + 1) * sizeof(WCHAR));
1089
1090 RegSetValueExW(hLocaleKey,
1091 L"sLanguage",
1092 0,
1093 REG_SZ,
1094 (PBYTE)pGlobalData->szMiscLanguage,
1095 (wcslen(pGlobalData->szMiscLanguage) + 1) * sizeof(WCHAR));
1096
1097 _itow(pGlobalData->nMiscCountry,
1098 szBuffer, DECIMAL_RADIX);
1099 RegSetValueExW(hLocaleKey,
1100 L"iCountry",
1101 0,
1102 REG_SZ,
1103 (PBYTE)szBuffer,
1104 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1105}
1106
1107
1108/* Sets new locale */
1109VOID
1111 PGLOBALDATA pGlobalData)
1112{
1113 HKEY hLocaleKey;
1114 DWORD ret;
1115
1116 if (pGlobalData->bApplyToDefaultUser)
1117 {
1119 L".DEFAULT\\Control Panel\\International",
1120 0,
1121 KEY_WRITE,
1122 &hLocaleKey);
1123 if (ret != ERROR_SUCCESS)
1124 {
1126 return;
1127 }
1128
1129 SaveUserLocale(pGlobalData, hLocaleKey);
1130
1131 /* Flush and close the locale key */
1132 RegFlushKey(hLocaleKey);
1133 RegCloseKey(hLocaleKey);
1134 }
1135
1137 L"Control Panel\\International",
1138 0,
1139 KEY_WRITE,
1140 &hLocaleKey);
1141 if (ret != ERROR_SUCCESS)
1142 {
1144 return;
1145 }
1146
1147 SaveUserLocale(pGlobalData, hLocaleKey);
1148
1149 /* Flush and close the locale key */
1150 RegFlushKey(hLocaleKey);
1151 RegCloseKey(hLocaleKey);
1152
1153 /* Set the new locale for the current process */
1154 NtSetDefaultLocale(TRUE, pGlobalData->UserLCID);
1155}
1156
1157/* Location enumerate procedure */
1158BOOL
1161{
1162 WCHAR loc[MAX_STR_SIZE];
1163 INT index;
1164
1166 return TRUE;
1167
1170 0,
1171 (LPARAM)loc);
1172
1175 index,
1176 (LPARAM)gId);
1177
1178 return TRUE;
1179}
1180
1181/* Enumerate all system locations identifiers */
1182static
1183GEOID
1185{
1186 GEOID userGeoID;
1187 WCHAR loc[MAX_STR_SIZE];
1188
1189 hGeoList = hWnd;
1190
1192
1193 /* Select current location */
1194 userGeoID = GetUserGeoID(GEOCLASS_NATION);
1195 GetGeoInfoW(userGeoID,
1197 loc,
1199 GetThreadLocale());
1200
1203 (WPARAM) -1,
1204 (LPARAM)loc);
1205
1206 return userGeoID;
1207}
1208
1209VOID
1211 PGLOBALDATA pGlobalData)
1212{
1213 HKEY hGeoKey;
1214 WCHAR value[15];
1215 DWORD valuesize;
1216 DWORD ret;
1217
1218 wsprintf(value, L"%lu", (DWORD)pGlobalData->geoid);
1219 valuesize = (wcslen(value) + 1) * sizeof(WCHAR);
1220
1221 if (pGlobalData->bApplyToDefaultUser)
1222 {
1224 L".DEFAULT\\Control Panel\\International\\Geo",
1225 0,
1226 KEY_WRITE,
1227 &hGeoKey);
1228 if (ret != ERROR_SUCCESS)
1229 {
1231 return;
1232 }
1233
1234 ret = RegSetValueExW(hGeoKey,
1235 L"Nation",
1236 0,
1237 REG_SZ,
1238 (PBYTE)value,
1239 valuesize);
1240
1241 RegFlushKey(hGeoKey);
1242 RegCloseKey(hGeoKey);
1243
1244 if (ret != ERROR_SUCCESS)
1245 {
1247 return;
1248 }
1249 }
1250
1252 L"Control Panel\\International\\Geo",
1253 0,
1254 KEY_WRITE,
1255 &hGeoKey);
1256 if (ret != ERROR_SUCCESS)
1257 {
1259 return;
1260 }
1261
1262 ret = RegSetValueExW(hGeoKey,
1263 L"Nation",
1264 0,
1265 REG_SZ,
1266 (PBYTE)value,
1267 valuesize);
1268
1269 RegFlushKey(hGeoKey);
1270 RegCloseKey(hGeoKey);
1271
1272 if (ret != ERROR_SUCCESS)
1273 {
1275 return;
1276 }
1277}
1278
1279DWORD
1281{
1282 LRESULT lCount, lIndex, lResult;
1283
1284 lCount = SendMessage(hList, CB_GETCOUNT, (WPARAM)0, (LPARAM)0);
1285 if (lCount == CB_ERR)
1286 {
1287 return 0;
1288 }
1289
1290 for (lIndex = 0; lIndex < lCount; lIndex++)
1291 {
1292 lResult = SendMessage(hList, CB_GETITEMDATA, (WPARAM)lIndex, (LPARAM)0);
1293 if (lResult == CB_ERR)
1294 {
1295 continue;
1296 }
1297
1298 if (lResult == (LRESULT)UnattendLCID)
1299 {
1301 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1302 return 1;
1303 }
1304 }
1305
1306 return 0;
1307}
1308
1309
1310static
1311VOID
1313 PROPSHEETPAGEW *psp,
1314 WORD idDlg,
1316 PGLOBALDATA pGlobalData)
1317{
1318 ZeroMemory(psp, sizeof(PROPSHEETPAGEW));
1319 psp->dwSize = sizeof(PROPSHEETPAGEW);
1320 psp->dwFlags = PSP_DEFAULT;
1321 psp->hInstance = hApplet;
1323 psp->pfnDlgProc = DlgProc;
1324 psp->lParam = (LPARAM)pGlobalData;
1325}
1326
1327static int CALLBACK
1329{
1330 // NOTE: This callback is needed to set large icon correctly.
1331 HICON hIcon;
1332 switch (uMsg)
1333 {
1334 case PSCB_INITIALIZED:
1335 {
1337 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
1338 break;
1339 }
1340 }
1341 return 0;
1342}
1343
1344INT_PTR
1347 HWND hwndDlg,
1348 PGLOBALDATA pGlobalData)
1349{
1350 PROPSHEETPAGEW PsPage[NUM_SHEETS + 1];
1351 PROPSHEETHEADERW psh;
1352
1353 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
1354 psh.dwSize = sizeof(PROPSHEETHEADER);
1356 psh.hwndParent = hwndDlg;
1357 psh.hInstance = hApplet;
1360 psh.nPages = (sizeof(PsPage) / sizeof(PROPSHEETPAGE)) - 1;
1361 psh.nStartPage = 0;
1362 psh.ppsp = PsPage;
1364
1365 InitPropSheetPage(&PsPage[0], IDD_NUMBERSPAGE, NumbersPageProc, pGlobalData);
1366 InitPropSheetPage(&PsPage[1], IDD_CURRENCYPAGE, CurrencyPageProc, pGlobalData);
1367 InitPropSheetPage(&PsPage[2], IDD_TIMEPAGE, TimePageProc, pGlobalData);
1368 InitPropSheetPage(&PsPage[3], IDD_DATEPAGE, DatePageProc, pGlobalData);
1369
1370 if (IsSortPageNeeded(pGlobalData->UserLCID))
1371 {
1372 psh.nPages++;
1373 InitPropSheetPage(&PsPage[4], IDD_SORTPAGE, SortPageProc, pGlobalData);
1374 }
1375
1376 return PropertySheetW(&psh);
1377}
1378
1379
1380/* Property page dialog callback */
1383 UINT uMsg,
1384 WPARAM wParam,
1385 LPARAM lParam)
1386{
1387 PGLOBALDATA pGlobalData;
1388
1389 pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1390
1391 switch (uMsg)
1392 {
1393 case WM_INITDIALOG:
1394 pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1395 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
1396
1397 if (pGlobalData)
1398 {
1399 LoadCurrentLocale(pGlobalData);
1400
1402 UpdateLocaleSample(hwndDlg, pGlobalData);
1403 pGlobalData->geoid = CreateLocationsList(GetDlgItem(hwndDlg, IDC_LOCATION_COMBO));
1405 {
1406 if (VerifyUnattendLCID(hwndDlg))
1407 {
1408 SetNewLocale(pGlobalData, UnattendLCID);
1409 SaveCurrentLocale(pGlobalData);
1410 PostQuitMessage(0);
1411 }
1412 else
1413 {
1414 DPRINT1("VerifyUnattendLCID failed\n");
1415 }
1416 return TRUE;
1417 }
1418 }
1419 break;
1420
1421 case WM_COMMAND:
1422 switch (LOWORD(wParam))
1423 {
1424 case IDC_LANGUAGELIST:
1425 if (HIWORD(wParam) == CBN_SELCHANGE)
1426 {
1427 LCID NewLcid;
1428 INT iCurSel;
1429
1430 iCurSel = SendMessage(hList,
1432 0,
1433 0);
1434 if (iCurSel == CB_ERR)
1435 break;
1436
1437 NewLcid = SendMessage(hList,
1439 iCurSel,
1440 0);
1441 if (NewLcid == (LCID)CB_ERR)
1442 break;
1443
1444 SetNewLocale(pGlobalData, NewLcid);
1445 UpdateLocaleSample(hwndDlg, pGlobalData);
1446 pGlobalData->bUserLocaleChanged = TRUE;
1447
1448 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1449 }
1450 break;
1451
1452 case IDC_LOCATION_COMBO:
1453 if (HIWORD(wParam) == CBN_SELCHANGE)
1454 {
1455 GEOID NewGeoID;
1456 INT iCurSel;
1457
1458 iCurSel = SendMessage(GetDlgItem(hwndDlg, IDC_LOCATION_COMBO),
1460 0,
1461 0);
1462 if (iCurSel == CB_ERR)
1463 break;
1464
1465 NewGeoID = SendMessage(GetDlgItem(hwndDlg, IDC_LOCATION_COMBO),
1467 iCurSel,
1468 0);
1469 if (NewGeoID == (GEOID)CB_ERR)
1470 break;
1471
1472 pGlobalData->geoid = NewGeoID;
1473 pGlobalData->bGeoIdChanged = TRUE;
1474
1475 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1476 }
1477 break;
1478
1479 case IDC_SETUP_BUTTON:
1480 if (CustomizeLocalePropertySheet(GetParent(hwndDlg), pGlobalData) > 0)
1481 {
1482 UpdateLocaleSample(hwndDlg, pGlobalData);
1483 pGlobalData->bUserLocaleChanged = TRUE;
1484 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
1485 }
1486 break;
1487 }
1488 break;
1489
1490 case WM_NOTIFY:
1491 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
1492 {
1493 /* Apply changes */
1494 PropSheet_UnChanged(GetParent(hwndDlg), hwndDlg);
1495
1496 /* Set new locale */
1497 if (pGlobalData->bUserLocaleChanged == TRUE)
1498 {
1499 SaveCurrentLocale(pGlobalData);
1500 pGlobalData->bUserLocaleChanged = FALSE;
1501 }
1502
1503 /* Set new GEO ID */
1504 if (pGlobalData->bGeoIdChanged == TRUE)
1505 {
1506 SaveGeoID(pGlobalData);
1507 pGlobalData->bGeoIdChanged = FALSE;
1508 }
1509
1510 AddNewKbLayoutsByLcid(pGlobalData->UserLCID);
1511
1512 /* Post WM_WININICHANGE messages to system */
1514 }
1515 break;
1516 }
1517
1518 return FALSE;
1519}
1520
1521/* EOF */
HWND hWnd
Definition: settings.c:17
#define index(s, c)
Definition: various.h:29
#define DPRINT1
Definition: precomp.h:8
#define IDC_LANGUAGELIST
Definition: resource.h:15
#define IDS_SPAIN
Definition: resource.h:32
#define RegCloseKey(hKey)
Definition: registry.h:49
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
INT_PTR CALLBACK CurrencyPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: currency.c:351
#define DLGPROC
Definition: maze.c:62
#define ERROR_SUCCESS
Definition: deptool.c:10
WORD idDlg
Definition: desk.c:121
DLGPROC DlgProc
Definition: desk.c:122
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
#define IDC_CPLICON
Definition: resource.h:7
INT_PTR CALLBACK DatePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: date.c:544
#define IDD_DATEPAGE
Definition: resource.h:11
#define IDS_ERROR_DEF_INT_KEY_REG
Definition: resource.h:83
#define IDD_CURRENCYPAGE
Definition: resource.h:14
#define IDC_LOCATION_COMBO
Definition: resource.h:51
#define IDC_NUMSAMPLE_EDIT
Definition: resource.h:19
#define IDS_CUSTOMIZE_TITLE
Definition: resource.h:75
#define IDD_SORTPAGE
Definition: resource.h:15
#define IDS_ERROR_INT_KEY_REG
Definition: resource.h:82
#define IDD_NUMBERSPAGE
Definition: resource.h:10
#define IDC_SETUP_BUTTON
Definition: resource.h:24
#define IDC_FULLTIMESAMPLE_EDIT
Definition: resource.h:23
#define IDC_SHORTTIMESAMPLE_EDIT
Definition: resource.h:22
#define IDC_MONEYSAMPLE_EDIT
Definition: resource.h:20
#define IDC_TIMESAMPLE_EDIT
Definition: resource.h:21
#define IDD_TIMEPAGE
Definition: resource.h:16
#define APIENTRY
Definition: api.h:79
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegFlushKey(HKEY hKey)
Definition: reg.c:2951
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
static VOID UpdateLocaleSample(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: generalp.c:103
INT_PTR APIENTRY CustomizeLocalePropertySheet(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: generalp.c:1346
VOID SaveGeoID(PGLOBALDATA pGlobalData)
Definition: generalp.c:1210
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: generalp.c:1328
HWND hLocaleList
Definition: generalp.c:40
HWND hList
Definition: generalp.c:39
static VOID SaveUserLocale(PGLOBALDATA pGlobalData, HKEY hLocaleKey)
Definition: generalp.c:803
static VOID CreateLanguagesList(HWND hwnd)
Definition: generalp.c:167
#define SAMPLE_NUMBER
Definition: generalp.c:32
BOOL CALLBACK LocationsEnumProc(GEOID gId)
Definition: generalp.c:1160
static BOOL CALLBACK GeneralPropertyPageLocalesEnumProc(LPTSTR lpLocale)
Definition: generalp.c:52
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: generalp.c:1382
VOID SetNewLocale(PGLOBALDATA pGlobalData, LCID lcid)
Definition: generalp.c:572
GROUPINGDATA GroupingFormats[MAX_GROUPINGFORMATS]
Definition: generalp.c:44
static GEOID CreateLocationsList(HWND hWnd)
Definition: generalp.c:1184
DWORD VerifyUnattendLCID(HWND hwndDlg)
Definition: generalp.c:1280
VOID SaveCurrentLocale(PGLOBALDATA pGlobalData)
Definition: generalp.c:1110
HWND hGeoList
Definition: generalp.c:40
BOOL isSpain
Definition: generalp.c:41
BOOL LoadCurrentLocale(PGLOBALDATA pGlobalData)
Definition: generalp.c:187
static VOID InitPropSheetPage(PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc, PGLOBALDATA pGlobalData)
Definition: generalp.c:1312
#define NUM_SHEETS
Definition: generalp.c:34
GLuint index
Definition: glext.h:6031
#define MAX_STR_SIZE
Definition: hdwwiz.h:21
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP wchar_t *__cdecl _itow(_In_ int _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
DWORD UnattendLCID
Definition: intl.c:41
DWORD IsUnattendedSetupEnabled
Definition: intl.c:40
VOID PrintErrorMsgBox(UINT msg)
Definition: intl.c:51
BOOL IsSortPageNeeded(LCID lcid)
Definition: sort.c:32
#define MAX_TIMESEPARATOR
Definition: intl.h:39
#define MAX_NUMNEGATIVESIGN
Definition: intl.h:28
VOID AddNewKbLayoutsByLcid(LCID Lcid)
Definition: kblayouts.c:189
INT_PTR CALLBACK TimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: time.c:220
#define MAX_NUMPOSITIVESIGN
Definition: intl.h:29
#define MAX_GROUPINGFORMATS
Definition: intl.h:51
#define DECIMAL_RADIX
Definition: intl.h:19
#define MAX_MISCCOUNTRY
Definition: intl.h:48
#define MAX_NUMDECIMALSEP
Definition: intl.h:26
INT_PTR CALLBACK NumbersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: numbers.c:581
#define MAX_MISCLANGUAGE
Definition: intl.h:49
#define MAX_CURRSYMBOL
Definition: intl.h:33
#define MAX_CURRTHOUSANDSEP
Definition: intl.h:35
#define MAX_LONGDATEFORMAT
Definition: intl.h:44
struct _GLOBALDATA * PGLOBALDATA
#define MAX_TIMEPMSYMBOL
Definition: intl.h:41
#define MAX_SHORTDATEFORMAT
Definition: intl.h:43
#define MAX_CURRDECIMALSEP
Definition: intl.h:34
INT_PTR CALLBACK SortPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: sort.c:147
#define MAX_DATESEPARATOR
Definition: intl.h:45
#define MAX_NUMLISTSEP
Definition: intl.h:30
#define MAX_SAMPLES_STR_SIZE
Definition: intl.h:24
#define MAX_NUMNATIVEDIGITS
Definition: intl.h:31
#define MAX_TIMEAMSYMBOL
Definition: intl.h:40
#define MAX_NUMTHOUSANDSEP
Definition: intl.h:27
#define MAX_TIMEFORMAT
Definition: intl.h:38
GEOID WINAPI GetUserGeoID(GEOCLASS GeoClass)
Definition: lang.c:3763
LCID WINAPI GetThreadLocale(void)
Definition: lang.c:1459
BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW lpfnLocaleEnum, DWORD dwFlags)
Definition: lang.c:1614
INT WINAPI GetGeoInfoW(GEOID geoid, GEOTYPE geotype, LPWSTR data, int data_len, LANGID lang)
Definition: lang.c:3980
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: lang.c:1558
LCID WINAPI GetUserDefaultLCID(void)
Definition: lang.c:778
BOOL WINAPI EnumSystemGeoID(GEOCLASS geoclass, GEOID parent, GEO_ENUMPROC enumproc)
Definition: lang.c:3702
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1108
#define REG_SZ
Definition: layer.c:22
INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const NUMBERFMTW *lpFormat, LPWSTR lpNumberStr, int cchOut)
Definition: lcformat.c:1212
INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const CURRENCYFMTW *lpFormat, LPWSTR lpCurrencyStr, int cchOut)
Definition: lcformat.c:1578
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
ULONG GEOID
Definition: mui.h:28
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static PVOID ptr
Definition: dispmode.c:27
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_WRITE
Definition: nt_native.h:1031
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
NTSTATUS NTAPI NtSetDefaultLocale(IN BOOLEAN UserProfile, IN LCID DefaultLocaleId)
Definition: locale.c:437
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
BYTE * PBYTE
Definition: pedump.c:66
#define INT
Definition: polytest.cpp:20
TCHAR langSel[255]
Definition: powercfg.c:24
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSP_DEFAULT
Definition: prsht.h:22
#define PropSheet_UnChanged(d, w)
Definition: prsht.h:358
#define PSN_APPLY
Definition: prsht.h:117
struct _PROPSHEETPAGEW PROPSHEETPAGEW
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define PROPSHEETPAGE
Definition: prsht.h:389
#define WM_NOTIFY
Definition: richedit.h:61
_In_ UCHAR _In_ ULONG _Out_ PUCHAR _Outptr_result_bytebuffer_ OutBufferLength PVOID * OutBuffer
Definition: scsi.h:4071
#define SUBLANG_SPANISH
Definition: nls.h:336
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_SPANISH
Definition: nls.h:123
DWORD LCID
Definition: nls.h:13
#define SUBLANG_SPANISH_MODERN
Definition: nls.h:338
UINT nInteger
Definition: intl.h:127
PWSTR pszString
Definition: intl.h:128
BOOL bApplyToDefaultUser
Definition: intl.h:116
WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP]
Definition: intl.h:83
INT nCurrGrouping
Definition: intl.h:87
INT nCurrDigits
Definition: intl.h:86
WCHAR szShortDateFormat[MAX_SHORTDATEFORMAT]
Definition: intl.h:100
INT nCalendarType
Definition: intl.h:105
INT nNumGrouping
Definition: intl.h:76
INT nMiscCountry
Definition: intl.h:111
INT nTimeLeadingZero
Definition: intl.h:96
WCHAR szTimePM[MAX_TIMEPMSYMBOL]
Definition: intl.h:93
WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP]
Definition: intl.h:82
WCHAR szNumListSep[MAX_NUMLISTSEP]
Definition: intl.h:72
INT nNumNegFormat
Definition: intl.h:73
LCID UserLCID
Definition: intl.h:113
WCHAR szTimeFormat[MAX_TIMEFORMAT]
Definition: intl.h:90
WCHAR szLongDateFormat[MAX_LONGDATEFORMAT]
Definition: intl.h:99
INT nNumDigits
Definition: intl.h:74
WCHAR szTimeAM[MAX_TIMEAMSYMBOL]
Definition: intl.h:92
WCHAR szNumNativeDigits[MAX_NUMNATIVEDIGITS]
Definition: intl.h:66
INT nCurrPosFormat
Definition: intl.h:84
WCHAR szDateSep[MAX_DATESEPARATOR]
Definition: intl.h:101
INT nFirstWeekOfYear
Definition: intl.h:103
WCHAR szCurrSymbol[MAX_CURRSYMBOL]
Definition: intl.h:81
WCHAR szNumPositiveSign[MAX_NUMPOSITIVESIGN]
Definition: intl.h:65
INT nFirstDayOfWeek
Definition: intl.h:102
WCHAR szMiscLanguage[MAX_MISCLANGUAGE]
Definition: intl.h:110
INT nDate
Definition: intl.h:104
INT nCurrNegFormat
Definition: intl.h:85
WCHAR szNumDecimalSep[MAX_NUMDECIMALSEP]
Definition: intl.h:69
INT nNumLeadingZero
Definition: intl.h:75
INT nTime
Definition: intl.h:94
WCHAR szNumNegativeSign[MAX_NUMNEGATIVESIGN]
Definition: intl.h:71
GEOID geoid
Definition: intl.h:118
WCHAR szTimeSep[MAX_TIMESEPARATOR]
Definition: intl.h:91
INT nNumMeasure
Definition: intl.h:77
INT nTimePrefix
Definition: intl.h:95
WCHAR szMiscCountry[MAX_MISCCOUNTRY]
Definition: intl.h:109
WCHAR szNumThousandSep[MAX_NUMTHOUSANDSEP]
Definition: intl.h:70
INT nNumShape
Definition: intl.h:78
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
UINT nStartPage
Definition: prsht.h:304
LPCWSTR pszCaption
Definition: prsht.h:301
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPARAM lParam
Definition: prsht.h:227
LPCWSTR pszTemplate
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:216
UINT LeadingZero
Definition: winnls.h:613
LPWSTR lpDecimalSep
Definition: winnls.h:615
UINT NumDigits
Definition: winnls.h:612
LPWSTR lpCurrencySymbol
Definition: winnls.h:619
UINT PositiveOrder
Definition: winnls.h:618
UINT Grouping
Definition: winnls.h:614
UINT NegativeOrder
Definition: winnls.h:617
LPWSTR lpThousandSep
Definition: winnls.h:616
UINT LeadingZero
Definition: winnls.h:635
UINT NegativeOrder
Definition: winnls.h:639
LPSTR lpDecimalSep
Definition: winnls.h:637
LPSTR lpThousandSep
Definition: winnls.h:638
UINT Grouping
Definition: winnls.h:636
UINT NumDigits
Definition: winnls.h:634
Definition: inflate.c:139
#define ICON_BIG
Definition: tnclass.cpp:51
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
Definition: pdh_main.c:94
static const WCHAR lang[]
Definition: wbemdisp.c:287
int ret
#define ZeroMemory
Definition: winbase.h:1712
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define LOCALE_ICURRDIGITS
Definition: winnls.h:54
#define LOCALE_SCOUNTRY
Definition: winnls.h:31
#define LOCALE_SDATE
Definition: winnls.h:58
#define LCID_INSTALLED
Definition: winnls.h:201
#define LOCALE_SGROUPING
Definition: winnls.h:44
#define LOCALE_ICOUNTRY
Definition: winnls.h:30
#define LOCALE_SDECIMAL
Definition: winnls.h:42
@ GEO_FRIENDLYNAME
Definition: winnls.h:569
#define LOCALE_IDATE
Definition: winnls.h:63
#define LOCALE_IFIRSTWEEKOFYEAR
Definition: winnls.h:76
#define LOCALE_IMEASURE
Definition: winnls.h:41
#define GetLocaleInfo
Definition: winnls.h:1186
#define LOCALE_SLONGDATE
Definition: winnls.h:61
#define LOCALE_S1159
Definition: winnls.h:71
#define LOCALE_SSHORTDATE
Definition: winnls.h:60
#define LOCALE_SPOSITIVESIGN
Definition: winnls.h:117
#define LOCALE_SMONDECIMALSEP
Definition: winnls.h:51
#define LOCALE_ITIME
Definition: winnls.h:65
#define LOCALE_ICURRENCY
Definition: winnls.h:56
#define LOCALE_ITLZERO
Definition: winnls.h:68
#define LOCALE_SLANGUAGE
Definition: winnls.h:26
#define LOCALE_SMONTHOUSANDSEP
Definition: winnls.h:52
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
#define LOCALE_IDIGITS
Definition: winnls.h:45
#define LCID_SUPPORTED
Definition: winnls.h:202
#define LOCALE_STHOUSAND
Definition: winnls.h:43
#define LOCALE_STIMEFORMAT
Definition: winnls.h:62
#define LOCALE_IFIRSTDAYOFWEEK
Definition: winnls.h:75
#define LOCALE_STIME
Definition: winnls.h:59
#define LOCALE_INEGNUMBER
Definition: winnls.h:47
#define LOCALE_SNEGATIVESIGN
Definition: winnls.h:118
#define LOCALE_S2359
Definition: winnls.h:72
#define LOCALE_SNATIVEDIGITS
Definition: winnls.h:48
#define LOCALE_SLIST
Definition: winnls.h:40
#define LOCALE_ILZERO
Definition: winnls.h:46
#define LOCALE_ICALENDARTYPE
Definition: winnls.h:73
#define LOCALE_SMONGROUPING
Definition: winnls.h:53
#define LOCALE_SCURRENCY
Definition: winnls.h:49
#define LOCALE_INEGCURR
Definition: winnls.h:57
@ GEOCLASS_NATION
Definition: winnls.h:555
#define LOCALE_ITIMEMARKPOSN
Definition: winnls.h:66
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_USERS
Definition: winreg.h:13
#define CB_SELECTSTRING
Definition: winuser.h:1960
#define CB_SETITEMDATA
Definition: winuser.h:1966
#define DWLP_USER
Definition: winuser.h:872
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define HWND_BROADCAST
Definition: winuser.h:1204
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_WININICHANGE
Definition: winuser.h:1630
#define CB_ERR
Definition: winuser.h:2435
#define CB_SETCURSEL
Definition: winuser.h:1961
#define WM_INITDIALOG
Definition: winuser.h:1739
#define CB_GETCOUNT
Definition: winuser.h:1942
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define CBN_SELCHANGE
Definition: winuser.h:1979
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETTEXT
Definition: winuser.h:1617
#define CB_ADDSTRING
Definition: winuser.h:1936
#define CB_GETITEMDATA
Definition: winuser.h:1950
#define SendMessage
Definition: winuser.h:5843
#define wsprintf
Definition: winuser.h:5865
HWND WINAPI GetParent(_In_ HWND)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define CB_GETCURSEL
Definition: winuser.h:1943
#define MAKEINTRESOURCE
Definition: winuser.h:591
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180
CHAR * LPTSTR
Definition: xmlstorage.h:192