3 * Copyright (C) 2004 ReactOS Team
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.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * PROJECT: ReactOS International Control Panel
22 * FILE: lib/cpl/intl/intl.c
23 * PURPOSE: Property sheet code
24 * PROGRAMMER: Eric Kohl
34 #define NUM_APPLETS (2)
37 Applet(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
);
40 HINSTANCE hApplet
= 0;
44 APPLET Applets
[NUM_APPLETS
] =
46 {IDC_CPLICON
, IDS_CPLNAME
, IDS_CPLDESCRIPTION
, Applet
}
51 InitPropSheetPage(PROPSHEETPAGE
*psp
, WORD idDlg
, DLGPROC DlgProc
)
53 ZeroMemory(psp
, sizeof(PROPSHEETPAGE
));
54 psp
->dwSize
= sizeof(PROPSHEETPAGE
);
55 psp
->dwFlags
= PSP_DEFAULT
;
56 psp
->hInstance
= hApplet
;
57 psp
->pszTemplate
= MAKEINTRESOURCE(idDlg
);
58 psp
->pfnDlgProc
= DlgProc
;
63 Applet(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
)
69 LoadString(hApplet
, IDS_CPLNAME
, Caption
, sizeof(Caption
) / sizeof(TCHAR
));
71 ZeroMemory(&psh
, sizeof(PROPSHEETHEADER
));
72 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
73 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_PROPTITLE
;
74 psh
.hwndParent
= NULL
;
75 psh
.hInstance
= hApplet
;
76 psh
.hIcon
= LoadIcon(hApplet
, MAKEINTRESOURCE(IDC_CPLICON
));
77 psh
.pszCaption
= Caption
;
78 psh
.nPages
= sizeof(psp
) / sizeof(PROPSHEETPAGE
);
82 InitPropSheetPage(&psp
[0], IDD_GENERALPAGE
, GeneralPageProc
);
83 InitPropSheetPage(&psp
[1], IDD_NUMBERSPAGE
, NumbersPageProc
);
84 InitPropSheetPage(&psp
[2], IDD_CURRENCYPAGE
, CurrencyPageProc
);
85 InitPropSheetPage(&psp
[3], IDD_TIMEPAGE
, TimePageProc
);
86 InitPropSheetPage(&psp
[4], IDD_DATEPAGE
, DatePageProc
);
87 InitPropSheetPage(&psp
[5], IDD_LOCALEPAGE
, LocalePageProc
);
89 return (LONG
)(PropertySheet(&psh
) != -1);
93 /* Control Panel Callback */
95 CPlApplet(HWND hwndCpl
,
110 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
111 UINT uAppIndex
= (UINT
)lParam1
;
114 CPlInfo
->idIcon
= Applets
[uAppIndex
].idIcon
;
115 CPlInfo
->idName
= Applets
[uAppIndex
].idName
;
116 CPlInfo
->idInfo
= Applets
[uAppIndex
].idDescription
;
122 UINT uAppIndex
= (UINT
)lParam1
;
123 Applets
[uAppIndex
].AppletProc(hwndCpl
, uMsg
, lParam1
, lParam2
);
133 DllMain(HINSTANCE hinstDLL
,
139 case DLL_PROCESS_ATTACH
:
140 case DLL_THREAD_ATTACH
: