ReactOS 0.4.15-dev-7085-g12a5971
intl.h File Reference
#include <stdarg.h>
#include <stdlib.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <winreg.h>
#include <winuser.h>
#include <cpl.h>
#include <setupapi.h>
#include <ndk/exfuncs.h>
#include "resource.h"
Include dependency graph for intl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _APPLET
 
struct  _GLOBALDATA
 
struct  GROUPINGDATA
 

Macros

#define WIN32_NO_STATUS
 
#define DECIMAL_RADIX   10
 
#define MAX_FMT_SIZE   30
 
#define MAX_STR_SIZE   128
 
#define MAX_SAMPLES_STR_SIZE   70
 
#define MAX_NUMDECIMALSEP   4
 
#define MAX_NUMTHOUSANDSEP   4
 
#define MAX_NUMNEGATIVESIGN   5
 
#define MAX_NUMPOSITIVESIGN   5
 
#define MAX_NUMLISTSEP   4
 
#define MAX_NUMNATIVEDIGITS   11
 
#define MAX_CURRSYMBOL   13
 
#define MAX_CURRDECIMALSEP   4
 
#define MAX_CURRTHOUSANDSEP   4
 
#define MAX_CURRGROUPING   10
 
#define MAX_TIMEFORMAT   80
 
#define MAX_TIMESEPARATOR   4
 
#define MAX_TIMEAMSYMBOL   15
 
#define MAX_TIMEPMSYMBOL   15
 
#define MAX_SHORTDATEFORMAT   80
 
#define MAX_LONGDATEFORMAT   80
 
#define MAX_DATESEPARATOR   4
 
#define MAX_YEAR_EDIT   4
 
#define MAX_MISCCOUNTRY   80
 
#define MAX_MISCLANGUAGE   80
 
#define MAX_GROUPINGFORMATS   3
 

Typedefs

typedef struct _APPLET APPLET
 
typedef struct _APPLETPAPPLET
 
typedef struct _GLOBALDATA GLOBALDATA
 
typedef struct _GLOBALDATAPGLOBALDATA
 

Functions

VOID PrintErrorMsgBox (UINT msg)
 
INT ResourceMessageBox (HWND hwnd, UINT uType, UINT uCaptionId, UINT uMessageId)
 
INT_PTR CALLBACK LanguagesPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK AdvancedPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK CurrencyPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK DatePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK GeneralPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
PWSTR GetLocaleString (PWSTR *pLocaleArray, LCTYPE lcType)
 
INT_PTR CALLBACK InpLocalePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK NumbersPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK TimePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL IsSortPageNeeded (LCID lcid)
 
INT_PTR CALLBACK SortPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
PWSTR InsSpacesFmt (PCWSTR szSourceStr, PCWSTR szFmtStr)
 
PWSTR ReplaceSubStr (PCWSTR szSourceStr, PCWSTR szStrToReplace, PCWSTR szTempl)
 
VOID GetSelectedComboBoxText (HWND hwndDlg, INT nIdDlgItem, PWSTR Buffer, UINT uSize)
 
VOID GetSelectedComboBoxIndex (HWND hwndDlg, INT nIdDlgItem, PINT pValue)
 
VOID AddNewKbLayoutsByLcid (LCID Lcid)
 

Variables

HINSTANCE hApplet
 
DWORD IsUnattendedSetupEnabled
 
DWORD UnattendLCID
 
GROUPINGDATA GroupingFormats [MAX_GROUPINGFORMATS]
 

Macro Definition Documentation

◆ DECIMAL_RADIX

#define DECIMAL_RADIX   10

Definition at line 19 of file intl.h.

◆ MAX_CURRDECIMALSEP

#define MAX_CURRDECIMALSEP   4

Definition at line 34 of file intl.h.

◆ MAX_CURRGROUPING

#define MAX_CURRGROUPING   10

Definition at line 36 of file intl.h.

◆ MAX_CURRSYMBOL

#define MAX_CURRSYMBOL   13

Definition at line 33 of file intl.h.

◆ MAX_CURRTHOUSANDSEP

#define MAX_CURRTHOUSANDSEP   4

Definition at line 35 of file intl.h.

◆ MAX_DATESEPARATOR

#define MAX_DATESEPARATOR   4

Definition at line 45 of file intl.h.

◆ MAX_FMT_SIZE

#define MAX_FMT_SIZE   30

Definition at line 22 of file intl.h.

◆ MAX_GROUPINGFORMATS

#define MAX_GROUPINGFORMATS   3

Definition at line 51 of file intl.h.

◆ MAX_LONGDATEFORMAT

#define MAX_LONGDATEFORMAT   80

Definition at line 44 of file intl.h.

◆ MAX_MISCCOUNTRY

#define MAX_MISCCOUNTRY   80

Definition at line 48 of file intl.h.

◆ MAX_MISCLANGUAGE

#define MAX_MISCLANGUAGE   80

Definition at line 49 of file intl.h.

◆ MAX_NUMDECIMALSEP

#define MAX_NUMDECIMALSEP   4

Definition at line 26 of file intl.h.

◆ MAX_NUMLISTSEP

#define MAX_NUMLISTSEP   4

Definition at line 30 of file intl.h.

◆ MAX_NUMNATIVEDIGITS

#define MAX_NUMNATIVEDIGITS   11

Definition at line 31 of file intl.h.

◆ MAX_NUMNEGATIVESIGN

#define MAX_NUMNEGATIVESIGN   5

Definition at line 28 of file intl.h.

◆ MAX_NUMPOSITIVESIGN

#define MAX_NUMPOSITIVESIGN   5

Definition at line 29 of file intl.h.

◆ MAX_NUMTHOUSANDSEP

#define MAX_NUMTHOUSANDSEP   4

Definition at line 27 of file intl.h.

◆ MAX_SAMPLES_STR_SIZE

#define MAX_SAMPLES_STR_SIZE   70

Definition at line 24 of file intl.h.

◆ MAX_SHORTDATEFORMAT

#define MAX_SHORTDATEFORMAT   80

Definition at line 43 of file intl.h.

◆ MAX_STR_SIZE

#define MAX_STR_SIZE   128

Definition at line 23 of file intl.h.

◆ MAX_TIMEAMSYMBOL

#define MAX_TIMEAMSYMBOL   15

Definition at line 40 of file intl.h.

◆ MAX_TIMEFORMAT

#define MAX_TIMEFORMAT   80

Definition at line 38 of file intl.h.

◆ MAX_TIMEPMSYMBOL

#define MAX_TIMEPMSYMBOL   15

Definition at line 41 of file intl.h.

◆ MAX_TIMESEPARATOR

#define MAX_TIMESEPARATOR   4

Definition at line 39 of file intl.h.

◆ MAX_YEAR_EDIT

#define MAX_YEAR_EDIT   4

Definition at line 46 of file intl.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 7 of file intl.h.

Typedef Documentation

◆ APPLET

◆ GLOBALDATA

◆ PAPPLET

typedef struct _APPLET * PAPPLET

◆ PGLOBALDATA

Function Documentation

◆ AddNewKbLayoutsByLcid()

VOID AddNewKbLayoutsByLcid ( LCID  Lcid)

Definition at line 189 of file kblayouts.c.

190{
191 HINF hIntlInf;
192 WCHAR szLang[CCH_LAYOUT_ID + 1], szLangID[CCH_LAYOUT_ID + 1];
193 WCHAR szLangStr[MAX_STR_SIZE], szLayoutStr[MAX_STR_SIZE], szStr[MAX_STR_SIZE];
194 INFCONTEXT InfContext;
195 LONG Count;
196 DWORD FieldCount, Index;
197
198 GetLocaleInfoW(MAKELCID(Lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, szLang, sizeof(szLang) / sizeof(WCHAR));
199 wsprintf(szLangID, L"0000%s", szLang);
200
201 hIntlInf = SetupOpenInfFileW(L"intl.inf", NULL, INF_STYLE_WIN4, NULL);
202
203 if (hIntlInf == INVALID_HANDLE_VALUE)
204 return;
205
206 if (!SetupOpenAppendInfFile(NULL, hIntlInf, NULL))
207 {
208 SetupCloseInfFile(hIntlInf);
209 hIntlInf = NULL;
210 return;
211 }
212
213 Count = SetupGetLineCount(hIntlInf, L"Locales");
214 if (Count <= 0) return;
215
216 if (SetupFindFirstLine(hIntlInf, L"Locales", szLangID, &InfContext))
217 {
218 FieldCount = SetupGetFieldCount(&InfContext);
219
220 if (FieldCount != 0)
221 {
222 for (Index = 5; Index <= FieldCount; Index++)
223 {
224 if (SetupGetStringField(&InfContext, Index, szStr, MAX_STR_SIZE, NULL))
225 {
226 INT i, j;
227
228 if (wcslen(szStr) != 13) continue;
229
230 wsprintf(szLangStr, L"0000%s", szStr);
231 szLangStr[8] = L'\0';
232
233 for (i = 5, j = 0; i <= wcslen(szStr); i++, j++)
234 szLayoutStr[j] = szStr[i];
235
236 AddNewLayout(szLayoutStr, szLangStr);
237 }
238 }
239 }
240 }
241 SetupCloseInfFile(hIntlInf);
242}
#define NULL
Definition: types.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define MAX_STR_SIZE
Definition: hdwwiz.h:21
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define INF_STYLE_WIN4
Definition: infsupp.h:41
#define CCH_LAYOUT_ID
Definition: kblayouts.c:11
static BOOL AddNewLayout(PWSTR szLayoutID, PWSTR szLangID)
Definition: kblayouts.c:122
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1108
int Count
Definition: noreturn.cpp:7
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define SetupFindFirstLine
Definition: setupapi.h:2624
#define SetupGetStringField
Definition: setupapi.h:2639
#define SetupGetLineCount
Definition: setupapi.h:2633
#define SetupOpenAppendInfFile
Definition: setupapi.h:2651
int32_t INT
Definition: typedefs.h:58
ULONG WINAPI SetupGetFieldCount(IN PINFCONTEXT Context)
Definition: infsupp.c:91
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
_In_ WDFCOLLECTION _In_ ULONG Index
#define LOCALE_ILANGUAGE
Definition: winnls.h:25
#define wsprintf
Definition: winuser.h:5864
_In_ CONST DEVPROPKEY _In_ LCID Lcid
Definition: iofuncs.h:2415
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by GeneralPageProc().

◆ AdvancedPageProc()

INT_PTR CALLBACK AdvancedPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 422 of file advanced.c.

426{
427 PGLOBALDATA pGlobalData;
428
429 pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
430
431 switch (uMsg)
432 {
433 case WM_INITDIALOG:
434 pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
435 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
436
437 InitLanguagesList(hwndDlg, pGlobalData);
438 InitCodePagesList(hwndDlg);
439 break;
440
441 case WM_COMMAND:
442 switch (LOWORD(wParam))
443 {
446 {
447 LCID lcid;
448 INT iIndex;
449
450 iIndex = SendMessage(hLangList, CB_GETCURSEL, 0, 0);
451 if (iIndex == CB_ERR)
452 break;
453
454 lcid = SendMessage(hLangList, CB_GETITEMDATA, iIndex, 0);
455 if (lcid == (LCID)CB_ERR)
456 break;
457
458 pGlobalData->SystemLCID = lcid;
459
460 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
461 }
462 break;
463
465 if (HIWORD(wParam) == BN_CLICKED)
466 {
468 {
469 ResourceMessageBox(hwndDlg,
473 pGlobalData->bApplyToDefaultUser = TRUE;
474 }
475 else
476 {
477 pGlobalData->bApplyToDefaultUser = FALSE;
478 }
479
480 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
481 }
482 break;
483 }
484 break;
485
486 case WM_NOTIFY:
487 if (((LPNMHDR)lParam)->code == PSN_APPLY)
488 {
489 PropSheet_UnChanged(GetParent(hwndDlg), hwndDlg);
490
491 SaveSystemSettings(pGlobalData);
492 SaveFontSubstitutionSettings(hwndDlg, pGlobalData);
493 SaveFontLinkingSettings(hwndDlg, pGlobalData);
494 }
495 else if (((LPNMHDR)lParam)->idFrom == IDC_CONV_TABLES &&
497 {
498 SetWindowLongPtr(hwndDlg,
501 return TRUE;
502 }
503 break;
504 }
505
506 return FALSE;
507}
VOID ResourceMessageBox(HINSTANCE hInstance, HWND hwnd, UINT uType, UINT uCaptionId, UINT uMessageId)
Definition: misc.c:282
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HWND hLangList
Definition: advanced.c:21
LRESULT ListViewCustomDraw(LPARAM lParam)
Definition: advanced.c:393
static VOID SaveFontLinkingSettings(HWND hwnd, PGLOBALDATA pGlobalData)
Definition: advanced.c:328
static VOID InitLanguagesList(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: advanced.c:237
static VOID SaveSystemSettings(PGLOBALDATA pGlobalData)
Definition: advanced.c:338
static VOID InitCodePagesList(HWND hwndDlg)
Definition: advanced.c:114
static VOID SaveFontSubstitutionSettings(HWND hwnd, PGLOBALDATA pGlobalData)
Definition: advanced.c:289
#define IDC_CONV_TABLES
Definition: resource.h:69
#define IDS_APPLY_DEFAULT_TITLE
Definition: resource.h:93
#define IDC_APPLY_CUR_USER_DEF_PROFILE
Definition: resource.h:68
#define IDC_LANGUAGE_COMBO
Definition: resource.h:53
#define IDS_APPLY_DEFAULT_TEXT
Definition: resource.h:94
struct _GLOBALDATA * PGLOBALDATA
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PropSheet_UnChanged(d, w)
Definition: prsht.h:358
#define PSN_APPLY
Definition: prsht.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define WM_NOTIFY
Definition: richedit.h:61
DWORD LCID
Definition: nls.h:13
BOOL bApplyToDefaultUser
Definition: intl.h:116
LCID SystemLCID
Definition: intl.h:114
Definition: inflate.c:139
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define HIWORD(l)
Definition: typedefs.h:247
#define DWLP_USER
Definition: winuser.h:871
#define WM_COMMAND
Definition: winuser.h:1739
#define CB_ERR
Definition: winuser.h:2434
#define WM_INITDIALOG
Definition: winuser.h:1738
#define CBN_SELCHANGE
Definition: winuser.h:1978
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_GETITEMDATA
Definition: winuser.h:1949
#define SendMessage
Definition: winuser.h:5842
#define MB_OK
Definition: winuser.h:789
#define MB_ICONWARNING
Definition: winuser.h:785
HWND WINAPI GetParent(_In_ HWND)
#define DWLP_MSGRESULT
Definition: winuser.h:869
#define BN_CLICKED
Definition: winuser.h:1924
#define CB_GETCURSEL
Definition: winuser.h:1942
#define BM_GETCHECK
Definition: winuser.h:1917

◆ CurrencyPageProc()

INT_PTR CALLBACK CurrencyPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 351 of file currency.c.

355{
356 PGLOBALDATA pGlobalData;
357
358 pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
359
360 switch (uMsg)
361 {
362 case WM_INITDIALOG:
363 pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
364 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
365
366 InitCurrencySymbols(hwndDlg, pGlobalData);
367 InitCurrencyPositiveFormats(hwndDlg, pGlobalData);
368 InitCurrencyNegativeFormats(hwndDlg, pGlobalData);
369 InitCurrencyDecimalSeparators(hwndDlg, pGlobalData);
370 InitCurrencyNumFracDigits(hwndDlg, pGlobalData);
371 InitCurrencyGroupSeparators(hwndDlg, pGlobalData);
372 InitDigitGroupCB(hwndDlg, pGlobalData);
373 UpdateExamples(hwndDlg, pGlobalData);
374 break;
375
376 case WM_COMMAND:
377 switch (LOWORD(wParam))
378 {
386 if (HIWORD(wParam) == CBN_SELCHANGE ||
388 {
389 /* Enable the Apply button */
390 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
391 }
392 }
393 break;
394
395 case WM_NOTIFY:
396 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
397 {
398 if (GetCurrencySetting(hwndDlg, pGlobalData))
399 {
400 pGlobalData->bUserLocaleChanged = TRUE;
401 UpdateExamples(hwndDlg, pGlobalData);
402 }
403 }
404 break;
405 }
406 return FALSE;
407}
static VOID InitDigitGroupCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:229
static VOID InitCurrencyGroupSeparators(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:207
static VOID InitCurrencyPositiveFormats(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:87
static VOID InitCurrencySymbols(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:65
static VOID InitCurrencyNumFracDigits(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:182
static VOID UpdateExamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:34
static VOID InitCurrencyDecimalSeparators(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:159
static VOID InitCurrencyNegativeFormats(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:123
static BOOL GetCurrencySetting(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: currency.c:266
#define IDC_CURRENCYSYMBOL
Definition: resource.h:27
#define IDC_CURRENCYNEGVALUE
Definition: resource.h:29
#define IDC_CURRENCYDECNUM
Definition: resource.h:31
#define IDC_CURRENCYGRPNUM
Definition: resource.h:33
#define IDC_CURRENCYPOSVALUE
Definition: resource.h:28
#define IDC_CURRENCYGRPSEP
Definition: resource.h:32
#define IDC_CURRENCYDECSEP
Definition: resource.h:30
unsigned int UINT
Definition: ndis.h:50
BOOL bUserLocaleChanged
Definition: intl.h:115
#define CBN_EDITCHANGE
Definition: winuser.h:1974

Referenced by CustomizeLocalePropertySheet().

◆ DatePageProc()

INT_PTR CALLBACK DatePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 544 of file date.c.

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 {
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
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}
static VOID UpdateDateLocaleSamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:496
static VOID SetMinDate(HWND hwndDlg)
Definition: date.c:425
static VOID InitShortDateSepSamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:236
static VOID InitMinMaxDateSpin(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:449
static BOOL GetDateSetting(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:519
static VOID SetMaxDate(HWND hwndDlg, LCID lcid)
Definition: date.c:383
static VOID InitLongDateCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:341
VOID InitShortDateCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: date.c:295
#define IDC_SECONDYEAR_EDIT
Definition: resource.h:55
#define IDC_SHRTDATESEP_COMBO
Definition: resource.h:62
#define IDC_HIJCHRON_COMBO
Definition: resource.h:58
#define IDC_LONGDATEFMT_COMBO
Definition: resource.h:65
#define IDC_CALTYPE_COMBO
Definition: resource.h:57
#define IDC_SHRTDATEFMT_COMBO
Definition: resource.h:61
LCID UserLCID
Definition: intl.h:113
BOOL bEnableYearNotification
Definition: intl.h:106
#define EN_CHANGE
Definition: winuser.h:2021

Referenced by CustomizeLocalePropertySheet().

◆ GeneralPageProc()

INT_PTR CALLBACK GeneralPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 327 of file propsheet_general.c.

331{
332 PPAGEDATA pPageData;
333
334 /* Get the window context */
335 pPageData = (PPAGEDATA)GetWindowLongPtr(hwndDlg,
337 if (pPageData == NULL && uMsg != WM_INITDIALOG)
338 {
339 return FALSE;
340 }
341
342 switch (uMsg)
343 {
344 case WM_INITDIALOG:
345 pPageData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PAGEDATA));
346 if (pPageData != NULL)
347 {
348 SetWindowLongPtr(hwndDlg,
350 (LONG_PTR)pPageData);
351
352 pPageData->dlgInfo = (PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam);
353 if (pPageData->dlgInfo != NULL)
354 {
355 InitGeneralPage(pPageData->dlgInfo, hwndDlg);
356 SetButtonStates(pPageData->dlgInfo, hwndDlg);
357 }
358 }
359 break;
360
361 case WM_DESTROY:
362 HeapFree(GetProcessHeap(), 0, pPageData);
363 break;
364
365 case WM_COMMAND:
366 switch(LOWORD(wParam))
367 {
368 case IDC_START_TYPE:
370 {
371 pPageData->bStartTypeChanged = TRUE;
372 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
373 }
374 break;
375
376 case IDC_DISP_NAME:
377 if (HIWORD(wParam) == EN_CHANGE)
378 {
379 pPageData->bDisplayNameChanged = TRUE;
380 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
381 }
382 break;
383
384 case IDC_DESCRIPTION:
385 if (HIWORD(wParam) == EN_CHANGE)
386 {
387 pPageData->bDescriptionChanged = TRUE;
388 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
389 }
390 break;
391
392 case IDC_EXEPATH:
393 if (HIWORD(wParam) == EN_CHANGE)
394 {
395 pPageData->bBinaryPathChanged = TRUE;
396 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
397 }
398 break;
399
400 case IDC_START:
401 {
402 WCHAR szStartParams[256];
403 LPWSTR lpStartParams = NULL;
404
405 if (GetDlgItemText(hwndDlg, IDC_START_PARAM, szStartParams, 256) > 0)
406 lpStartParams = szStartParams;
407
409
410 RunActionWithProgress(hwndDlg,
411 pPageData->dlgInfo->pService->lpServiceName,
412 pPageData->dlgInfo->pService->lpDisplayName,
414 lpStartParams);
415
417 ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
418 SetButtonStates(pPageData->dlgInfo, hwndDlg);
419 SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
420 break;
421 }
422
423 case IDC_STOP:
424 RunActionWithProgress(hwndDlg,
425 pPageData->dlgInfo->pService->lpServiceName,
426 pPageData->dlgInfo->pService->lpDisplayName,
428 NULL);
429
431 ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
432 SetButtonStates(pPageData->dlgInfo, hwndDlg);
433 SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
434 break;
435
436 case IDC_PAUSE:
437 RunActionWithProgress(hwndDlg,
438 pPageData->dlgInfo->pService->lpServiceName,
439 pPageData->dlgInfo->pService->lpDisplayName,
441 NULL);
442
444 ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
445 SetButtonStates(pPageData->dlgInfo, hwndDlg);
446 SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
447 break;
448
449 case IDC_RESUME:
450 RunActionWithProgress(hwndDlg,
451 pPageData->dlgInfo->pService->lpServiceName,
452 pPageData->dlgInfo->pService->lpDisplayName,
454 NULL);
455
457 ChangeListViewText(pPageData->dlgInfo->Info, pPageData->dlgInfo->pService, LVSTATUS);
458 SetButtonStates(pPageData->dlgInfo, hwndDlg);
459 SetServiceStatusText(pPageData->dlgInfo, hwndDlg);
460 break;
461
462 case IDC_EDIT:
467 break;
468 }
469 break;
470
471 case WM_NOTIFY:
472 switch (((LPNMHDR)lParam)->code)
473 {
474 case PSN_APPLY:
475 if (pPageData->bDisplayNameChanged ||
476 pPageData->bDescriptionChanged ||
477 pPageData->bBinaryPathChanged ||
478 pPageData->bStartTypeChanged)
479 {
480 SaveDlgInfo(pPageData, hwndDlg);
481 SetButtonStates(pPageData->dlgInfo, hwndDlg);
482 pPageData->bDisplayNameChanged = FALSE;
483 pPageData->bDescriptionChanged = FALSE;
484 pPageData->bBinaryPathChanged = FALSE;
485 pPageData->bStartTypeChanged = FALSE;
486 }
487 break;
488 }
489 break;
490 }
491
492 return FALSE;
493}
#define IDC_PAUSE
Definition: resource.h:75
#define IDC_STOP
Definition: resource.h:69
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
#define ACTION_START
Definition: precomp.h:40
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:372
#define ACTION_PAUSE
Definition: precomp.h:42
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
#define LVSTATUS
Definition: precomp.h:31
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
#define ACTION_STOP
Definition: precomp.h:41
#define ACTION_RESUME
Definition: precomp.h:43
#define IDC_DESCRIPTION
Definition: resource.h:129
#define IDC_START
Definition: resource.h:135
#define IDC_EXEPATH
Definition: resource.h:130
#define IDC_EDIT
Definition: resource.h:134
#define IDC_RESUME
Definition: resource.h:138
#define IDC_START_TYPE
Definition: resource.h:131
#define IDC_START_PARAM
Definition: resource.h:133
#define IDC_DISP_NAME
Definition: resource.h:128
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static VOID InitGeneralPage(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
static VOID SetButtonStates(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
struct _PAGEDATA * PPAGEDATA
VOID SaveDlgInfo(PPAGEDATA pPageData, HWND hwndDlg)
static VOID SetServiceStatusText(PSERVICEPROPSHEET dlgInfo, HWND hwndDlg)
PSERVICEPROPSHEET dlgInfo
BOOL bDescriptionChanged
BOOL bDisplayNameChanged
BOOL bStartTypeChanged
BOOL bBinaryPathChanged
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:132
PMAIN_WND_INFO Info
Definition: precomp.h:131
#define GWLP_USERDATA
Definition: treelist.c:63
#define EM_SETREADONLY
Definition: winuser.h:2014
#define GetDlgItemText
Definition: winuser.h:5784
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define WM_DESTROY
Definition: winuser.h:1608
#define SendDlgItemMessage
Definition: winuser.h:5841
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ GetLocaleString()

PWSTR GetLocaleString ( PWSTR pLocaleArray,
LCTYPE  lcType 
)

◆ GetSelectedComboBoxIndex()

VOID GetSelectedComboBoxIndex ( HWND  hwndDlg,
INT  nIdDlgItem,
PINT  pValue 
)

Definition at line 223 of file misc.c.

227{
228 *pValue = SendDlgItemMessageW(hwndDlg, nIdDlgItem, CB_GETCURSEL, 0, 0);
229}
PWCHAR pValue

Referenced by GetCurrencySetting(), and GetNumberSetting().

◆ GetSelectedComboBoxText()

VOID GetSelectedComboBoxText ( HWND  hwndDlg,
INT  nIdDlgItem,
PWSTR  Buffer,
UINT  uSize 
)

Definition at line 176 of file misc.c.

181{
182 HWND hChildWnd;
183 PWSTR tmp;
184 INT nIndex;
185 UINT uReqSize;
186
187 /* Get handle to time format control */
188 hChildWnd = GetDlgItem(hwndDlg, nIdDlgItem);
189 if (hChildWnd == NULL)
190 return;
191
192 /* Get index to selected time format */
193 nIndex = SendMessageW(hChildWnd, CB_GETCURSEL, 0, 0);
194 if (nIndex == CB_ERR)
195 {
196 /* No selection? Get content of the edit control */
197 SendMessageW(hChildWnd, WM_GETTEXT, uSize, (LPARAM)Buffer);
198 }
199 else
200 {
201 /* Get requested size, including the null terminator;
202 * it shouldn't be required because the previous CB_LIMITTEXT,
203 * but it would be better to check it anyways */
204 uReqSize = SendMessageW(hChildWnd, CB_GETLBTEXTLEN, (WPARAM)nIndex, 0) + 1;
205
206 /* Allocate enough space to be more safe */
207 tmp = (PWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, uReqSize * sizeof(WCHAR));
208 if (tmp != NULL)
209 {
210 /* Get selected time format text */
211 SendMessageW(hChildWnd, CB_GETLBTEXT, (WPARAM)nIndex, (LPARAM)tmp);
212
213 /* Finally, copy the result into the output */
214 wcsncpy(Buffer, tmp, uSize);
215
216 HeapFree(GetProcessHeap(), 0, tmp);
217 }
218 }
219}
Definition: bufpool.h:45
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
uint16_t * PWSTR
Definition: typedefs.h:56
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define CB_GETLBTEXTLEN
Definition: winuser.h:1952
#define CB_GETLBTEXT
Definition: winuser.h:1951
#define WM_GETTEXT
Definition: winuser.h:1617
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by GetCurrencySetting(), GetNumberSetting(), and GetTimeSetting().

◆ InpLocalePageProc()

INT_PTR CALLBACK InpLocalePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 30 of file inplocale.c.

34{
35 switch (uMsg)
36 {
37 case WM_INITDIALOG:
38 break;
39 }
40 return FALSE;
41}

◆ InsSpacesFmt()

PWSTR InsSpacesFmt ( PCWSTR  szSourceStr,
PCWSTR  szFmtStr 
)

Definition at line 39 of file misc.c.

40{
41 PWSTR pszDestStr;
42 PWSTR pszTempStr;
43 WCHAR szFmtVal[255];
44 UINT nFmtCount = 0;
45 INT nValCount = 0;
46 INT nLastVal = 0;
47 INT nSpaceOffset = 0;
48 BOOL wasNul=FALSE;
49
50 pszDestStr = (PWSTR)HeapAlloc(GetProcessHeap(), 0, 255 * sizeof(WCHAR));
51 if (pszDestStr == NULL)
52 return NULL;
53
54 wcscpy(pszDestStr, szSourceStr);
55
56 /* If format is clean return source string */
57 if (!*szFmtStr)
58 return pszDestStr;
59
60 /* Search for all format values */
61 for (nFmtCount = 0; nFmtCount <= wcslen(szFmtStr); nFmtCount++)
62 {
63 if (szFmtStr[nFmtCount] == L';' || szFmtStr[nFmtCount] == L'\0')
64 {
65 if (_wtoi(szFmtVal) == 0 && !wasNul)
66 {
67 wasNul=TRUE;
68 break;
69 }
70
71 /* If was 0, repeat spaces */
72 if (wasNul)
73 {
74 nSpaceOffset += nLastVal;
75 }
76 else
77 {
78 nSpaceOffset += _wtoi(szFmtVal);
79 }
80
81 szFmtVal[nValCount] = L'\0';
82 nValCount=0;
83
84 /* Insert space to finded position plus all pos before */
85 pszTempStr = InsSpacePos(pszDestStr, nSpaceOffset);
86 wcscpy(pszDestStr,pszTempStr);
87 HeapFree(GetProcessHeap(), 0, pszTempStr);
88
89 /* Num of spaces total increment */
90 if (!wasNul)
91 {
92 nSpaceOffset++;
93 nLastVal = _wtoi(szFmtVal);
94 }
95 }
96 else
97 {
98 szFmtVal[nValCount++] = szFmtStr[nFmtCount];
99 }
100 }
101
102 /* Create spaces for rest part of string */
103 if (wasNul && nLastVal != 0)
104 {
105 for (nFmtCount = nSpaceOffset + nLastVal; nFmtCount < wcslen(pszDestStr); nFmtCount += nLastVal + 1)
106 {
107 pszTempStr = InsSpacePos(pszDestStr, nFmtCount);
108 wcscpy(pszDestStr, pszTempStr);
109 HeapFree(GetProcessHeap(), 0, pszTempStr);
110 }
111 }
112
113 return pszDestStr;
114}
PWSTR InsSpacePos(PCWSTR szInsStr, const int nPos)
Definition: misc.c:5
unsigned int BOOL
Definition: ntddk_ex.h:94
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)

Referenced by InitFieldDigNumCB().

◆ IsSortPageNeeded()

BOOL IsSortPageNeeded ( LCID  lcid)

Definition at line 32 of file sort.c.

33{
34 /* Handle special case for Spanish (Spain) */
37 return TRUE;
38
39 userLcid = lcid;
41
43
44 return bSortPage;
45}
static LCID userLcid
Definition: sort.c:11
static BOOL CALLBACK SortTestEnumProc(PWSTR lpLocale)
Definition: sort.c:17
static BOOL bSortPage
Definition: sort.c:10
BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW lpfnLocaleEnum, DWORD dwFlags)
Definition: lang.c:1614
#define SUBLANG_SPANISH
Definition: nls.h:336
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_SPANISH
Definition: nls.h:123
#define SUBLANG_SPANISH_MODERN
Definition: nls.h:338
#define LCID_ALTERNATE_SORTS
Definition: winnls.h:203

Referenced by CustomizeLocalePropertySheet().

◆ LanguagesPageProc()

INT_PTR CALLBACK LanguagesPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 48 of file languages.c.

52{
53 SHELLEXECUTEINFOW shInputDll;
54 PGLOBALDATA pGlobalData;
55
56 pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
57
58 switch (uMsg)
59 {
60 case WM_INITDIALOG:
61 pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
62 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
63
64 if (!pGlobalData->bIsUserAdmin)
65 {
68 }
69
70 /* EAST ASIAN specific */
72 {
73 case LANG_JAPANESE:
74 if (HasJapanesePackage(hwndDlg))
75 {
77 }
78 break;
79
80 case LANG_CHINESE: /* Not supported yet */
81 case LANG_KOREAN: /* Not supported yet */
82 default:
84 break;
85 }
86 break;
87
88 case WM_COMMAND:
89 switch (LOWORD(wParam))
90 {
91 /* If "detail" button pressed */
93 if (HIWORD(wParam) == BN_CLICKED)
94 {
95 memset(&shInputDll, 0x0, sizeof(SHELLEXECUTEINFOW));
96 shInputDll.cbSize = sizeof(shInputDll);
97 shInputDll.hwnd = hwndDlg;
98 shInputDll.lpVerb = L"open";
99 shInputDll.lpFile = L"RunDll32.exe";
100 shInputDll.lpParameters = L"shell32.dll,Control_RunDLL input.dll";
101 if (ShellExecuteExW(&shInputDll) == 0)
102 {
104 }
105 }
106 break;
107
109 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
110 break;
111 }
112 break;
113
114 case WM_NOTIFY:
115 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) /* Apply changes */
116 {
117 /* EAST ASIAN specific */
119 {
120 case LANG_JAPANESE:
122 {
123 if (!HasJapanesePackage(hwndDlg))
124 {
125 /* Install now */
126 ShellExecuteW(hwndDlg, NULL, L"rapps.exe", L"/INSTALL jpn-package",
128 }
129 }
130 else
131 {
132 WCHAR szUninstall[MAX_PATH];
133 if (GetJapaneseUninstallCmdLine(hwndDlg, szUninstall, _countof(szUninstall)))
134 {
135 /* Go to arguments of command line */
136 PWCHAR pchArgs = PathGetArgsW(szUninstall);
137 if (pchArgs && *pchArgs)
138 {
139 --pchArgs;
140 /* pchArgs pointer is inside szUninstall,
141 * so we have to split both strings */
142 *pchArgs = UNICODE_NULL;
143 ++pchArgs;
144 }
145 PathUnquoteSpacesW(szUninstall);
146
147 /* Uninstall now */
148 ShellExecuteW(hwndDlg, NULL, szUninstall, pchArgs, NULL, SW_SHOWNORMAL);
149 }
150 }
151 break;
152
153 case LANG_CHINESE: /* Not supported yet */
154 case LANG_KOREAN: /* Not supported yet */
155 default:
156 break;
157 }
158
159 PropSheet_UnChanged(GetParent(hwndDlg), hwndDlg);
160 }
161 break;
162 }
163 return FALSE;
164}
#define IDC_DETAIL_BUTTON
Definition: resource.h:52
#define IDC_INST_FILES_FOR_RTOL_LANG
Definition: resource.h:66
#define IDS_ERROR_INPUT_DLL
Definition: resource.h:90
#define IDC_INST_FILES_FOR_ASIAN
Definition: resource.h:67
#define MAX_PATH
Definition: compat.h:34
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
Definition: path.c:1034
LPWSTR WINAPI PathGetArgsW(LPCWSTR lpszPath)
Definition: path.c:506
VOID PrintErrorMsgBox(UINT msg)
Definition: intl.c:51
LANGID WINAPI GetUserDefaultLangID(void)
Definition: lang.c:744
BOOL HasJapanesePackage(HWND hwnd)
Definition: languages.c:40
BOOL GetJapaneseUninstallCmdLine(HWND hwnd, LPWSTR pszCmdLine, SIZE_T cchCmdLine)
Definition: languages.c:9
#define UNICODE_NULL
#define LANG_CHINESE
Definition: nls.h:42
#define LANG_JAPANESE
Definition: nls.h:76
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define LANG_KOREAN
Definition: nls.h:84
#define memset(x, y, z)
Definition: compat.h:39
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2379
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2368
#define _countof(array)
Definition: sndvol32.h:68
BOOL bIsUserAdmin
Definition: intl.h:122
LPCWSTR lpParameters
Definition: shellapi.h:330
uint16_t * PWCHAR
Definition: typedefs.h:56
#define SW_SHOWNORMAL
Definition: winuser.h:769
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define BST_CHECKED
Definition: winuser.h:197

Referenced by Applet().

◆ NumbersPageProc()

INT_PTR CALLBACK NumbersPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 581 of file numbers.c.

585{
586 PGLOBALDATA pGlobalData;
587
588 pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
589
590 switch (uMsg)
591 {
592 case WM_INITDIALOG:
593 pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
594 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
595
596 InitNumDecimalSepCB(hwndDlg, pGlobalData);
597 InitNumOfFracSymbCB(hwndDlg, pGlobalData);
598 InitNumFieldSepCB(hwndDlg, pGlobalData);
599 InitFieldDigNumCB(hwndDlg, pGlobalData);
600 InitNegSignCB(hwndDlg, pGlobalData);
601 InitNegNumFmtCB(hwndDlg, pGlobalData);
602 InitLeadingZeroesCB(hwndDlg, pGlobalData);
603 InitListSepCB(hwndDlg, pGlobalData);
604 InitUnitsSysCB(hwndDlg, pGlobalData);
605 UpdateNumSamples(hwndDlg, pGlobalData);
606 break;
607
608 case WM_COMMAND:
609 switch (LOWORD(wParam))
610 {
618 case IDC_NUMBERSLSEP:
621 {
622 /* Enable the Apply button */
623 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
624 }
625 }
626 break;
627
628 case WM_NOTIFY:
629 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
630 {
631 if (GetNumberSetting(hwndDlg, pGlobalData))
632 {
633 pGlobalData->bUserLocaleChanged = TRUE;
634 UpdateNumSamples(hwndDlg, pGlobalData);
635 }
636 }
637 break;
638 }
639 return FALSE;
640}
static VOID InitNumDecimalSepCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:59
static VOID InitUnitsSysCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:399
static VOID UpdateNumSamples(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:431
static VOID InitNumOfFracSymbCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:107
static VOID InitFieldDigNumCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:187
static VOID InitNegNumFmtCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:268
static VOID InitNumFieldSepCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:139
static BOOL GetNumberSetting(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:474
static VOID InitLeadingZeroesCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:315
static VOID InitNegSignCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:220
static VOID InitListSepCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: numbers.c:350
#define IDC_NUMBERDSYMBOL
Definition: resource.h:36
#define IDC_NUMBERSNDIGDEC
Definition: resource.h:37
#define IDC_NUMBERSLSEP
Definition: resource.h:43
#define IDC_NUMBERSDIGITGRSYM
Definition: resource.h:38
#define IDC_NUMBERSMEASSYS
Definition: resource.h:44
#define IDC_NUMBERSNSIGNSYM
Definition: resource.h:40
#define IDC_NUMBERSNNUMFORMAT
Definition: resource.h:41
#define IDC_NUMBERSDISPLEADZER
Definition: resource.h:42
#define IDC_NUMBERSDGROUPING
Definition: resource.h:39

Referenced by CustomizeLocalePropertySheet().

◆ PrintErrorMsgBox()

VOID PrintErrorMsgBox ( UINT  msg)

Definition at line 51 of file intl.c.

52{
53 WCHAR szErrorText[BUFFERSIZE];
54 WCHAR szErrorCaption[BUFFERSIZE];
55
56 LoadStringW(hApplet, msg, szErrorText, sizeof(szErrorText) / sizeof(WCHAR));
57 LoadStringW(hApplet, IDS_ERROR, szErrorCaption, sizeof(szErrorCaption) / sizeof(WCHAR));
58
59 MessageBoxW(NULL, szErrorText, szErrorCaption, MB_OK | MB_ICONERROR);
60}
#define msg(x)
Definition: auth_time.c:54
#define IDS_ERROR
Definition: resource.h:18
#define BUFFERSIZE
Definition: intl.c:32
HINSTANCE hApplet
Definition: intl.c:38
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:786

Referenced by LanguagesPageProc(), LoadCurrentLocale(), SaveCurrentLocale(), SaveFontSubstitutionSettings(), SaveGeoID(), SaveSystemSettings(), SetLongDateFormat(), SetShortDateFormat(), and SetShortDateSep().

◆ ReplaceSubStr()

PWSTR ReplaceSubStr ( PCWSTR  szSourceStr,
PCWSTR  szStrToReplace,
PCWSTR  szTempl 
)

Definition at line 118 of file misc.c.

121{
122 PWSTR szDestStr;
123 UINT nCharCnt;
124 UINT nSubStrCnt;
125 UINT nDestStrCnt;
126 UINT nFirstCharCnt;
127
128 szDestStr = (PWSTR)HeapAlloc(GetProcessHeap(), 0, MAX_SAMPLES_STR_SIZE * sizeof(WCHAR));
129 if (szDestStr == NULL)
130 return NULL;
131
132 nDestStrCnt = 0;
133 nFirstCharCnt = 0;
134
135 wcscpy(szDestStr, L"");
136
137 while (nFirstCharCnt < wcslen(szSourceStr))
138 {
139 if (szSourceStr[nFirstCharCnt] == szTempl[0])
140 {
141 nSubStrCnt = 0;
142 for (nCharCnt = nFirstCharCnt; nCharCnt < nFirstCharCnt + wcslen(szTempl); nCharCnt++)
143 {
144 if (szSourceStr[nCharCnt] == szTempl[nSubStrCnt])
145 {
146 nSubStrCnt++;
147 }
148 else
149 {
150 break;
151 }
152
153 if (wcslen(szTempl) == nSubStrCnt)
154 {
155 wcscat(szDestStr, szStrToReplace);
156 nDestStrCnt = wcslen(szDestStr);
157 nFirstCharCnt += wcslen(szTempl) - 1;
158 break;
159 }
160 }
161 }
162 else
163 {
164 szDestStr[nDestStrCnt++] = szSourceStr[nFirstCharCnt];
165 szDestStr[nDestStrCnt] = L'\0';
166 }
167
168 nFirstCharCnt++;
169 }
170
171 return szDestStr;
172}
#define MAX_SAMPLES_STR_SIZE
Definition: intl.h:24
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)

Referenced by InitLeadingZeroesCB(), InitNegNumFmtCB(), and SetShortDateFormat().

◆ ResourceMessageBox()

INT ResourceMessageBox ( HWND  hwnd,
UINT  uType,
UINT  uCaptionId,
UINT  uMessageId 
)

Definition at line 63 of file intl.c.

68{
69 WCHAR szErrorText[BUFFERSIZE];
70 WCHAR szErrorCaption[BUFFERSIZE];
71
72 LoadStringW(hApplet, uMessageId, szErrorText, sizeof(szErrorText) / sizeof(WCHAR));
73 LoadStringW(hApplet, uCaptionId, szErrorCaption, sizeof(szErrorCaption) / sizeof(WCHAR));
74
75 return MessageBoxW(hwnd, szErrorText, szErrorCaption, uType);
76}
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ SortPageProc()

INT_PTR CALLBACK SortPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 147 of file sort.c.

151{
152 PGLOBALDATA pGlobalData;
153
154 pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
155
156 switch (uMsg)
157 {
158 case WM_INITDIALOG:
159 pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
160 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
161
162 CreateSortList(GetDlgItem(hwndDlg, IDC_SORTLIST_COMBO), pGlobalData->UserLCID);
163 break;
164
165 case WM_COMMAND:
166 switch (LOWORD(wParam))
167 {
170 {
171 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
172 }
173 break;
174 }
175 break;
176
177 case WM_NOTIFY:
178 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
179 {
180 LCID NewLcid;
181 INT iCurSel;
182
183 iCurSel = SendDlgItemMessage(hwndDlg,
186 0,
187 0);
188 if (iCurSel == CB_ERR)
189 break;
190
191 NewLcid = SendDlgItemMessage(hwndDlg,
194 iCurSel,
195 0);
196 if (NewLcid == (LCID)CB_ERR)
197 break;
198
199 /* Save the new LCID */
200 pGlobalData->UserLCID = NewLcid;
201 pGlobalData->bUserLocaleChanged = TRUE;
202 }
203 break;
204 }
205
206 return FALSE;
207}
#define IDC_SORTLIST_COMBO
Definition: resource.h:70
static VOID CreateSortList(HWND hwnd, LCID lcid)
Definition: sort.c:77

Referenced by CustomizeLocalePropertySheet().

◆ TimePageProc()

INT_PTR CALLBACK TimePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 220 of file time.c.

224{
225 PGLOBALDATA pGlobalData;
226
227 pGlobalData = (PGLOBALDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
228
229 switch (uMsg)
230 {
231 case WM_INITDIALOG:
232 pGlobalData = (PGLOBALDATA)((LPPROPSHEETPAGE)lParam)->lParam;
233 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
234
235 /* Get the time format */
236 InitTimeFormatCB(hwndDlg, pGlobalData);
237
238 /* Get the time separator */
239 InitTimeSeparatorCB(hwndDlg, pGlobalData);
240
241 /* Get the AM symbol */
242 InitAmSymbol(hwndDlg, pGlobalData);
243
244 /* Get the PM symbol */
245 InitPmSymbol(hwndDlg, pGlobalData);
246
247 /* Update the time format sample */
248 UpdateTimeSample(hwndDlg, pGlobalData);
249 break;
250
251 case WM_COMMAND:
252 switch (LOWORD(wParam))
253 {
254 case IDC_TIMEFORMAT:
256 case IDC_TIMEAMSYMBOL:
257 case IDC_TIMEPMSYMBOL:
258 if (HIWORD(wParam) == CBN_SELCHANGE ||
260 {
261 /* Enable the Apply button */
262 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
263 }
264 break;
265 }
266 break;
267
268 case WM_NOTIFY:
269 if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY)
270 {
271 if (GetTimeSetting(hwndDlg, pGlobalData))
272 {
273 pGlobalData->bUserLocaleChanged = TRUE;
274 UpdateTimeSample(hwndDlg, pGlobalData);
275 }
276 }
277 break;
278 }
279
280 return FALSE;
281}
#define IDC_TIMEPMSYMBOL
Definition: resource.h:49
#define IDC_TIMEAMSYMBOL
Definition: resource.h:48
#define IDC_TIMESEPARATOR
Definition: resource.h:47
#define IDC_TIMEFORMAT
Definition: resource.h:46
static BOOL GetTimeSetting(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: time.c:160
static VOID InitAmSymbol(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: time.c:97
static VOID InitTimeFormatCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: time.c:56
static VOID InitTimeSeparatorCB(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: time.c:76
static VOID UpdateTimeSample(HWND hWnd, PGLOBALDATA pGlobalData)
Definition: time.c:43
static VOID InitPmSymbol(HWND hwndDlg, PGLOBALDATA pGlobalData)
Definition: time.c:129

Referenced by CustomizeLocalePropertySheet().

Variable Documentation

◆ GroupingFormats

◆ hApplet

HINSTANCE hApplet
extern

Definition at line 17 of file access.c.

◆ IsUnattendedSetupEnabled

DWORD IsUnattendedSetupEnabled
extern

Definition at line 40 of file intl.c.

Referenced by GeneralPageProc(), and ParseSetupInf().

◆ UnattendLCID

DWORD UnattendLCID
extern

Definition at line 41 of file intl.c.

Referenced by GeneralPageProc(), ParseSetupInf(), and VerifyUnattendLCID().