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 Sample Control Panel
22 * FILE: lib/cpl/cplsample/cplsample.c
23 * PURPOSE: ReactOS Sample Control Panel
24 * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
33 #include "cplsample.h"
35 #define NUM_APPLETS (1)
37 LONG APIENTRY
Applet1(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
);
38 HINSTANCE hApplet
= 0;
41 APPLET Applets
[NUM_APPLETS
] =
43 {IDC_CPLICON_1
, IDS_CPLNAME_1
, IDS_CPLDESCRIPTION_1
, Applet1
}
47 InitPropSheetPage(PROPSHEETPAGE
*psp
, WORD idDlg
, DLGPROC DlgProc
)
49 ZeroMemory(psp
, sizeof(PROPSHEETPAGE
));
50 psp
->dwSize
= sizeof(PROPSHEETPAGE
);
51 psp
->dwFlags
= PSP_DEFAULT
;
52 psp
->hInstance
= hApplet
;
53 psp
->pszTemplate
= MAKEINTRESOURCE(idDlg
);
54 psp
->pfnDlgProc
= DlgProc
;
57 /* Property page dialog callback */
74 /* Property page dialog callback */
91 /* Property page dialog callback */
108 /* Property Sheet Callback */
118 case PSCB_BUTTONPRESSED
:
121 case PSBTN_OK
: /* OK */
123 case PSBTN_CANCEL
: /* Cancel */
125 case PSBTN_APPLYNOW
: /* Apply now */
127 case PSBTN_FINISH
: /* Close */
134 case PSCB_INITIALIZED
:
143 Applet1(HWND hwnd
, UINT uMsg
, LONG wParam
, LONG lParam
)
145 PROPSHEETPAGE psp
[3];
149 LoadString(hApplet
, IDS_CPLNAME_1
, Caption
, sizeof(Caption
) / sizeof(TCHAR
));
151 ZeroMemory(&psh
, sizeof(PROPSHEETHEADER
));
152 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
153 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_USECALLBACK
| PSH_PROPTITLE
;
154 psh
.hwndParent
= NULL
;
155 psh
.hInstance
= hApplet
;
156 psh
.hIcon
= LoadIcon(hApplet
, MAKEINTRESOURCE(IDC_CPLICON_1
));
157 psh
.pszCaption
= Caption
;
158 psh
.nPages
= sizeof(psp
) / sizeof(PROPSHEETPAGE
);
161 psh
.pfnCallback
= PropSheetProc
;
163 InitPropSheetPage(&psp
[0], IDD_PROPPAGE1
, Page1Proc
);
164 InitPropSheetPage(&psp
[1], IDD_PROPPAGE2
, Page2Proc
);
165 InitPropSheetPage(&psp
[2], IDD_PROPPAGE3
, Page3Proc
);
167 return (LONG
)(PropertySheet(&psh
) != -1);
170 /* Control Panel Callback */
178 int i
= (int)lParam1
;
192 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
194 CPlInfo
->idIcon
= Applets
[i
].idIcon
;
195 CPlInfo
->idName
= Applets
[i
].idName
;
196 CPlInfo
->idInfo
= Applets
[i
].idDescription
;
201 Applets
[i
].AppletProc(hwndCPl
, uMsg
, lParam1
, lParam2
);
217 case DLL_PROCESS_ATTACH
:
218 case DLL_THREAD_ATTACH
: