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 INT_PTR CALLBACK
DisplayPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
41 INT_PTR CALLBACK
GeneralPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
42 INT_PTR CALLBACK
KeyboardPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
43 INT_PTR CALLBACK
MousePageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
44 INT_PTR CALLBACK
SoundPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
45 HINSTANCE hApplet
= 0;
48 APPLET Applets
[NUM_APPLETS
] =
50 {IDI_CPLACCESS
, IDS_CPLSYSTEMNAME
, IDS_CPLSYSTEMDESCRIPTION
, SystemApplet
}
54 InitPropSheetPage(PROPSHEETPAGE
*psp
, WORD idDlg
, DLGPROC DlgProc
)
56 ZeroMemory(psp
, sizeof(PROPSHEETPAGE
));
57 psp
->dwSize
= sizeof(PROPSHEETPAGE
);
58 psp
->dwFlags
= PSP_DEFAULT
;
59 psp
->hInstance
= hApplet
;
60 psp
->pszTemplate
= MAKEINTRESOURCE(idDlg
);
61 psp
->pfnDlgProc
= DlgProc
;
64 /* Property Sheet Callback */
74 case PSCB_BUTTONPRESSED
:
77 case PSBTN_OK
: /* OK */
79 case PSBTN_CANCEL
: /* Cancel */
81 case PSBTN_APPLYNOW
: /* Apply now */
83 case PSBTN_FINISH
: /* Close */
90 case PSCB_INITIALIZED
:
101 PROPSHEETPAGE psp
[5];
105 LoadString(hApplet
, IDS_CPLSYSTEMNAME
, Caption
, sizeof(Caption
) / sizeof(TCHAR
));
107 ZeroMemory(&psh
, sizeof(PROPSHEETHEADER
));
108 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
109 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_USECALLBACK
| PSH_PROPTITLE
;
110 psh
.hwndParent
= NULL
;
111 psh
.hInstance
= hApplet
;
112 psh
.hIcon
= LoadIcon(hApplet
, MAKEINTRESOURCE(IDI_CPLACCESS
));
113 psh
.pszCaption
= Caption
;
114 psh
.nPages
= sizeof(psp
) / sizeof(PROPSHEETPAGE
);
117 psh
.pfnCallback
= PropSheetProc
;
119 InitPropSheetPage(&psp
[0], IDD_PROPPAGEKEYBOARD
, KeyboardPageProc
);
120 InitPropSheetPage(&psp
[1], IDD_PROPPAGESOUND
, SoundPageProc
);
121 InitPropSheetPage(&psp
[2], IDD_PROPPAGEDISPLAY
, DisplayPageProc
);
122 InitPropSheetPage(&psp
[3], IDD_PROPPAGEMOUSE
, MousePageProc
);
123 InitPropSheetPage(&psp
[4], IDD_PROPPAGEGENERAL
, GeneralPageProc
);
125 return (LONG
)(PropertySheet(&psh
) != -1);
128 /* Control Panel Callback */
136 int i
= (int)lParam1
;
150 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
152 CPlInfo
->idIcon
= Applets
[i
].idIcon
;
153 CPlInfo
->idName
= Applets
[i
].idName
;
154 CPlInfo
->idInfo
= Applets
[i
].idDescription
;
159 Applets
[i
].AppletProc();
175 case DLL_PROCESS_ATTACH
:
176 case DLL_THREAD_ATTACH
: