2 * PROJECT: ReactOS International Control Panel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: lib/cpl/intl/intl.c
5 * PURPOSE: ReactOS International Control Panel
6 * PROGRAMMERS: Eric Kohl
7 * Alexey Zavyalov (gen_x@mail.ru)
10 /* INCLUDES *****************************************************************/
19 /* GLOBALS ******************************************************************/
21 #define NUM_APPLETS (1)
24 LONG APIENTRY
Applet(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
);
28 APPLET Applets
[NUM_APPLETS
] =
30 {IDC_CPLICON
, IDS_CPLNAME
, IDS_CPLDESCRIPTION
, Applet
}
33 /* FUNCTIONS ****************************************************************/
37 InitPropSheetPage(PROPSHEETPAGE
*PsPage
, WORD IdDlg
, DLGPROC DlgProc
)
39 ZeroMemory(PsPage
, sizeof(PROPSHEETPAGE
));
40 PsPage
->dwSize
= sizeof(PROPSHEETPAGE
);
41 PsPage
->dwFlags
= PSP_DEFAULT
;
42 PsPage
->hInstance
= hApplet
;
43 PsPage
->pszTemplate
= MAKEINTRESOURCE(IdDlg
);
44 PsPage
->pfnDlgProc
= DlgProc
;
50 Applet(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
)
53 PROPSHEETPAGE PsPage
[NUM_SHEETS
];
55 TCHAR Caption
[MAX_STR_SIZE
];
57 UNREFERENCED_PARAMETER(lParam
);
58 UNREFERENCED_PARAMETER(wParam
);
59 UNREFERENCED_PARAMETER(uMsg
);
60 UNREFERENCED_PARAMETER(hwnd
);
62 LoadString(hApplet
, IDS_CPLNAME
, Caption
, sizeof(Caption
) / sizeof(TCHAR
));
64 ZeroMemory(&psh
, sizeof(PROPSHEETHEADER
));
65 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
66 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_USECALLBACK
| PSH_PROPTITLE
;
67 psh
.hwndParent
= NULL
;
68 psh
.hInstance
= hApplet
;
69 psh
.hIcon
= LoadIcon(hApplet
, MAKEINTRESOURCE(IDC_CPLICON
));
70 psh
.pszCaption
= Caption
;
71 psh
.nPages
= sizeof(PsPage
) / sizeof(PROPSHEETPAGE
);
75 InitPropSheetPage(&PsPage
[0], IDD_REGOPTSPAGE
, RegOptsProc
);
76 InitPropSheetPage(&PsPage
[1], IDD_EXTRAOPTSPAGE
, ExtraOptsProc
);
77 InitPropSheetPage(&PsPage
[2], IDD_LANGSOPTSPAGE
, LangsOptsProc
);
79 return (LONG
)(PropertySheet(&psh
) != -1);
82 /* Control Panel Callback */
85 CPlApplet(HWND hwndCPl
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
)
99 CPLINFO
*CplInfo
= (CPLINFO
*)lParam2
;
100 UINT uAppIndex
= (UINT
)lParam1
;
103 CplInfo
->idIcon
= Applets
[uAppIndex
].idIcon
;
104 CplInfo
->idName
= Applets
[uAppIndex
].idName
;
105 CplInfo
->idInfo
= Applets
[uAppIndex
].idDescription
;
110 UINT uAppIndex
= (UINT
)lParam1
;
111 Applets
[uAppIndex
].AppletProc(hwndCPl
, uMsg
, lParam1
, lParam2
);
119 /* Standart DLL entry */
123 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
125 INITCOMMONCONTROLSEX InitControls
;
126 UNREFERENCED_PARAMETER(lpvReserved
);
129 case DLL_PROCESS_ATTACH
:
130 case DLL_THREAD_ATTACH
:
132 InitControls
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
133 InitControls
.dwICC
= ICC_LISTVIEW_CLASSES
| ICC_UPDOWN_CLASS
| ICC_BAR_CLASSES
;
134 InitCommonControlsEx(&InitControls
);