8a595a57bac7e3f8925e89fde6579c660b5965e7
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: desk.c,v 1.3 2004/10/13 10:17:41 ekohl Exp $
21 * PROJECT: ReactOS Display Control Panel
22 * FILE: lib/cpl/desk/desk.c
23 * PURPOSE: ReactOS Display Control Panel
24 * PROGRAMMER: Gero Kuehn (reactos.filter@gkware.com)
27 * 08-07-2004 Initial Checkin
44 #define NUM_APPLETS (1)
46 LONG CALLBACK
DisplayApplet(VOID
);
47 INT_PTR CALLBACK
BackgroundPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
48 INT_PTR CALLBACK
ScreenSaverPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
49 INT_PTR CALLBACK
AppearancePageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
50 INT_PTR CALLBACK
SettingsPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
53 HINSTANCE hApplet
= 0;
56 APPLET Applets
[NUM_APPLETS
] =
58 {IDI_CPLSYSTEM
, IDS_CPLSYSTEMNAME
, IDS_CPLSYSTEMDESCRIPTION
, DisplayApplet
}
63 /* Property page dialog callback */
65 BackgroundPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
78 /* Property page dialog callback */
80 ScreenSaverPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
93 /* Property page dialog callback */
95 AppearancePageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
108 /* Property page dialog callback */
110 SettingsPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
124 InitPropSheetPage(PROPSHEETPAGE
*psp
, WORD idDlg
, DLGPROC DlgProc
)
126 ZeroMemory(psp
, sizeof(PROPSHEETPAGE
));
127 psp
->dwSize
= sizeof(PROPSHEETPAGE
);
128 psp
->dwFlags
= PSP_DEFAULT
;
129 psp
->hInstance
= hApplet
;
130 psp
->pszTemplate
= MAKEINTRESOURCE(idDlg
);
131 psp
->pfnDlgProc
= DlgProc
;
140 PROPSHEETPAGE psp
[4];
144 LoadString(hApplet
, IDS_CPLSYSTEMNAME
, Caption
, sizeof(Caption
) / sizeof(TCHAR
));
146 ZeroMemory(&psh
, sizeof(PROPSHEETHEADER
));
147 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
148 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_PROPTITLE
;
149 psh
.hwndParent
= NULL
;
150 psh
.hInstance
= hApplet
;
151 psh
.hIcon
= LoadIcon(hApplet
, MAKEINTRESOURCE(IDI_CPLSYSTEM
));
152 psh
.pszCaption
= Caption
;
153 psh
.nPages
= sizeof(psp
) / sizeof(PROPSHEETPAGE
);
156 psh
.pfnCallback
= NULL
;
158 InitPropSheetPage(&psp
[0], IDD_PROPPAGEBACKGROUND
, BackgroundPageProc
);
159 InitPropSheetPage(&psp
[1], IDD_PROPPAGESCREENSAVER
, ScreenSaverPageProc
);
160 InitPropSheetPage(&psp
[2], IDD_PROPPAGEAPPEARANCE
, AppearancePageProc
);
161 InitPropSheetPage(&psp
[3], IDD_PROPPAGESETTINGS
, SettingsPageProc
);
163 return (LONG
)(PropertySheet(&psh
) != -1);
167 /* Control Panel Callback */
169 CPlApplet(HWND hwndCPl
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
)
171 int i
= (int)lParam1
;
185 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
187 CPlInfo
->idIcon
= Applets
[i
].idIcon
;
188 CPlInfo
->idName
= Applets
[i
].idName
;
189 CPlInfo
->idInfo
= Applets
[i
].idDescription
;
194 Applets
[i
].AppletProc();
203 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
207 case DLL_PROCESS_ATTACH
:
208 case DLL_THREAD_ATTACH
: