3 * Copyright (C) 2005 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: main.c 12852 2005-01-06 13:58:04Z mf $
21 * PROJECT: ReactOS Multimedia Control Panel
22 * FILE: lib/cpl/mmsys/mmsys.c
23 * PURPOSE: ReactOS Multimedia Control Panel
24 * PROGRAMMER: Thoams Weidenmueller <w3seek@reactos.com>
41 HWPD_STANDARDLIST
= 0,
43 HWPD_MAX
= HWPD_LARGELIST
44 } HWPAGE_DISPLAYMODE
, *PHWPAGE_DISPLAYMODE
;
47 DeviceCreateHardwarePageEx(HWND hWndParent
,
50 HWPAGE_DISPLAYMODE DisplayMode
);
52 #define NUM_APPLETS (1)
55 HINSTANCE hApplet
= 0;
58 const APPLET Applets
[NUM_APPLETS
] =
60 {IDI_CPLICON
, IDS_CPLNAME
, IDS_CPLDESCRIPTION
, MmSysApplet
},
63 /* Hardware property page dialog callback */
64 static INT_PTR CALLBACK
65 HardwareDlgProc(HWND hwndDlg
,
79 /* create the hardware page */
80 DeviceCreateHardwarePageEx(hwndDlg
,
82 sizeof(Guids
) / sizeof(Guids
[0]),
92 MmSysApplet(HWND hwnd
,
98 PROPSHEETHEADER psh
= {0};
104 sizeof(Caption
) / sizeof(TCHAR
));
106 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
107 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_PROPTITLE
;
108 psh
.hwndParent
= NULL
;
109 psh
.hInstance
= hApplet
;
110 psh
.hIcon
= LoadIcon(hApplet
,
111 MAKEINTRESOURCE(IDI_CPLICON
));
112 psh
.pszCaption
= Caption
;
113 psh
.nPages
= sizeof(psp
) / sizeof(PROPSHEETPAGE
);
117 InitPropSheetPage(&psp
[0],
121 return (LONG
)(PropertySheet(&psh
) != -1);
125 InitPropSheetPage(PROPSHEETPAGE
*psp
,
129 ZeroMemory(psp
, sizeof(PROPSHEETPAGE
));
130 psp
->dwSize
= sizeof(PROPSHEETPAGE
);
131 psp
->dwFlags
= PSP_DEFAULT
;
132 psp
->hInstance
= hApplet
;
133 psp
->pszTemplate
= MAKEINTRESOURCE(idDlg
);
134 psp
->pfnDlgProc
= DlgProc
;
138 /* Control Panel Callback */
140 CPlApplet(HWND hwndCpl
,
155 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
156 UINT uAppIndex
= (UINT
)lParam1
;
159 CPlInfo
->idIcon
= Applets
[uAppIndex
].idIcon
;
160 CPlInfo
->idName
= Applets
[uAppIndex
].idName
;
161 CPlInfo
->idInfo
= Applets
[uAppIndex
].idDescription
;
167 UINT uAppIndex
= (UINT
)lParam1
;
168 Applets
[uAppIndex
].AppletProc(hwndCpl
,
181 DllMain(HINSTANCE hinstDLL
,
187 case DLL_PROCESS_ATTACH
:
189 DisableThreadLibraryCalls(hinstDLL
);