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 LoadString(hApplet
, IDS_CPLNAME
, Caption
, sizeof(Caption
) / sizeof(TCHAR
));
59 ZeroMemory(&psh
, sizeof(PROPSHEETHEADER
));
60 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
61 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_USECALLBACK
| PSH_PROPTITLE
;
62 psh
.hwndParent
= NULL
;
63 psh
.hInstance
= hApplet
;
64 psh
.hIcon
= LoadIcon(hApplet
, MAKEINTRESOURCE(IDC_CPLICON
));
65 psh
.pszCaption
= Caption
;
66 psh
.nPages
= sizeof(PsPage
) / sizeof(PROPSHEETPAGE
);
70 InitPropSheetPage(&PsPage
[0], IDD_REGOPTSPAGE
, RegOptsProc
);
71 InitPropSheetPage(&PsPage
[1], IDD_EXTRAOPTSPAGE
, ExtraOptsProc
);
73 return (LONG
)(PropertySheet(&psh
) != -1);
76 /* Control Panel Callback */
79 CPlApplet(HWND hwndCPl
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
)
93 CPLINFO
*CplInfo
= (CPLINFO
*)lParam2
;
94 UINT uAppIndex
= (UINT
)lParam1
;
97 CplInfo
->idIcon
= Applets
[uAppIndex
].idIcon
;
98 CplInfo
->idName
= Applets
[uAppIndex
].idName
;
99 CplInfo
->idInfo
= Applets
[uAppIndex
].idDescription
;
104 UINT uAppIndex
= (UINT
)lParam1
;
105 Applets
[uAppIndex
].AppletProc(hwndCPl
, uMsg
, lParam1
, lParam2
);
113 /* Standart DLL entry */
117 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
119 INITCOMMONCONTROLSEX InitControls
;
122 case DLL_PROCESS_ATTACH
:
123 case DLL_THREAD_ATTACH
:
125 InitControls
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
126 InitControls
.dwICC
= ICC_LISTVIEW_CLASSES
| ICC_UPDOWN_CLASS
| ICC_BAR_CLASSES
;
127 InitCommonControlsEx(&InitControls
);