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 System Control Panel
22 * FILE: lib/cpl/system/sysdm.c
23 * PURPOSE: ReactOS System Control Panel
24 * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
37 #define NUM_APPLETS (1)
39 LONG CALLBACK
SystemApplet(VOID
);
40 HINSTANCE hApplet
= 0;
43 APPLET Applets
[NUM_APPLETS
] =
45 {IDI_CPLSYSTEM
, IDS_CPLSYSTEMNAME
, IDS_CPLSYSTEMDESCRIPTION
, SystemApplet
}
49 InitPropSheetPage(PROPSHEETPAGE
*psp
, WORD idDlg
, DLGPROC DlgProc
)
51 ZeroMemory(psp
, sizeof(PROPSHEETPAGE
));
52 psp
->dwSize
= sizeof(PROPSHEETPAGE
);
53 psp
->dwFlags
= PSP_DEFAULT
;
54 psp
->hInstance
= hApplet
;
55 psp
->pszTemplate
= MAKEINTRESOURCE(idDlg
);
56 psp
->pfnDlgProc
= DlgProc
;
59 /* Property Sheet Callback */
69 case PSCB_BUTTONPRESSED
:
72 case PSBTN_OK
: /* OK */
74 case PSBTN_CANCEL
: /* Cancel */
76 case PSBTN_APPLYNOW
: /* Apply now */
78 case PSBTN_FINISH
: /* Close */
85 case PSCB_INITIALIZED
:
100 LoadString(hApplet
, IDS_CPLSYSTEMNAME
, Caption
, sizeof(Caption
) / sizeof(TCHAR
));
102 ZeroMemory(&psh
, sizeof(PROPSHEETHEADER
));
103 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
104 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_PROPTITLE
; /* | PSH_USECALLBACK */
105 psh
.hwndParent
= NULL
;
106 psh
.hInstance
= hApplet
;
107 psh
.hIcon
= LoadIcon(hApplet
, MAKEINTRESOURCE(IDI_CPLSYSTEM
));
108 psh
.pszCaption
= Caption
;
109 psh
.nPages
= sizeof(psp
) / sizeof(PROPSHEETPAGE
);
112 psh
.pfnCallback
= NULL
; /* PropSheetProc; */
114 InitPropSheetPage(&psp
[0], IDD_PROPPAGEGENERAL
, GeneralPageProc
);
115 InitPropSheetPage(&psp
[1], IDD_PROPPAGECOMPUTER
, ComputerPageProc
);
116 InitPropSheetPage(&psp
[2], IDD_PROPPAGEHARDWARE
, HardwarePageProc
);
117 InitPropSheetPage(&psp
[3], IDD_PROPPAGEUSERPROFILE
, UserProfilePageProc
);
118 InitPropSheetPage(&psp
[4], IDD_PROPPAGEADVANCED
, AdvancedPageProc
);
120 return (LONG
)(PropertySheet(&psh
) != -1);
123 /* Control Panel Callback */
131 int i
= (int)lParam1
;
145 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
147 CPlInfo
->idIcon
= Applets
[i
].idIcon
;
148 CPlInfo
->idName
= Applets
[i
].idName
;
149 CPlInfo
->idInfo
= Applets
[i
].idDescription
;
154 Applets
[i
].AppletProc();
170 case DLL_PROCESS_ATTACH
:
171 case DLL_THREAD_ATTACH
: