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.
19 /* $Id: timedate.c,v 1.1 2004/10/30 19:15:31 ekohl Exp $
21 * PROJECT: ReactOS Timedate Control Panel
22 * FILE: lib/cpl/timedate/timedate.c
23 * PURPOSE: ReactOS Timedate Control Panel
24 * PROGRAMMER: Eric Kohl
35 #define NUM_APPLETS (1)
38 Applet(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
);
41 HINSTANCE hApplet
= 0;
45 APPLET Applets
[NUM_APPLETS
] =
47 {IDC_CPLICON
, IDS_CPLNAME
, IDS_CPLDESCRIPTION
, Applet
}
51 /* Property page dialog callback */
53 DateTimePageProc(HWND hwndDlg
,
68 /* Property page dialog callback */
70 TimeZonePageProc(HWND hwndDlg
,
86 InitPropSheetPage(PROPSHEETPAGE
*psp
, WORD idDlg
, DLGPROC DlgProc
)
88 ZeroMemory(psp
, sizeof(PROPSHEETPAGE
));
89 psp
->dwSize
= sizeof(PROPSHEETPAGE
);
90 psp
->dwFlags
= PSP_DEFAULT
;
91 psp
->hInstance
= hApplet
;
92 psp
->pszTemplate
= MAKEINTRESOURCE(idDlg
);
93 psp
->pfnDlgProc
= DlgProc
;
98 Applet(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
)
101 PROPSHEETPAGE psp
[3];
104 LoadString(hApplet
, IDS_CPLNAME
, Caption
, sizeof(Caption
) / sizeof(TCHAR
));
106 ZeroMemory(&psh
, sizeof(PROPSHEETHEADER
));
107 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
108 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_PROPTITLE
;
109 psh
.hwndParent
= NULL
;
110 psh
.hInstance
= hApplet
;
111 psh
.hIcon
= LoadIcon(hApplet
, MAKEINTRESOURCE(IDC_CPLICON
));
112 psh
.pszCaption
= Caption
;
113 psh
.nPages
= sizeof(psp
) / sizeof(PROPSHEETPAGE
);
117 InitPropSheetPage(&psp
[0], IDD_DATETIMEPAGE
, DateTimePageProc
);
118 InitPropSheetPage(&psp
[1], IDD_TIMEZONEPAGE
, TimeZonePageProc
);
120 return (LONG
)(PropertySheet(&psh
) != -1);
124 /* Control Panel Callback */
126 CPlApplet(HWND hwndCpl
,
131 int i
= (int)lParam1
;
143 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
145 CPlInfo
->idIcon
= Applets
[i
].idIcon
;
146 CPlInfo
->idName
= Applets
[i
].idName
;
147 CPlInfo
->idInfo
= Applets
[i
].idDescription
;
153 Applets
[i
].AppletProc(hwndCpl
, uMsg
, lParam1
, lParam2
);
162 DllMain(HINSTANCE hinstDLL
,
168 case DLL_PROCESS_ATTACH
:
169 case DLL_THREAD_ATTACH
: