2 * ReactOS New devices installation
3 * Copyright (C) 2005 ReactOS Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * PROJECT: ReactOS Add hardware control panel
21 * FILE: dll/cpl/hdwwiz/hdwwiz.c
22 * PURPOSE: ReactOS Add hardware control panel
23 * PROGRAMMER: Hervé Poussineau (hpoussin@reactos.org)
24 * Dmitry Chapyshev (dmitry@reactos.org)
37 HINSTANCE hApplet
= NULL
;
39 typedef BOOL (WINAPI
*PINSTALL_NEW_DEVICE
)(HWND
, LPGUID
, PDWORD
);
43 InstallNewDevice(HWND hwndParent
, LPGUID ClassGuid
, PDWORD pReboot
)
48 static INT_PTR CALLBACK
49 StartPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
54 static INT_PTR CALLBACK
55 SearchPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
60 static INT_PTR CALLBACK
61 IsConnctedPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
66 static INT_PTR CALLBACK
67 FinishPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
73 HardwareWizardInit(HWND hwnd
)
75 HPROPSHEETPAGE ahpsp
[3];
76 PROPSHEETPAGE psp
= {0};
80 /* Create the Start page, until setup is working */
81 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
82 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
83 psp
.hInstance
= hApplet
;
85 psp
.pfnDlgProc
= StartPageDlgProc
;
86 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_STARTPAGE
);
87 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
89 /* Create search page */
90 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
91 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
92 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SEARCHTITLE
);
93 psp
.pszHeaderSubTitle
= NULL
;
94 psp
.hInstance
= hApplet
;
96 psp
.pfnDlgProc
= SearchPageDlgProc
;
97 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_SEARCHPAGE
);
98 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
100 /* Create is connected page */
101 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
102 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
103 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_ISCONNECTED
);
104 psp
.pszHeaderSubTitle
= NULL
;
105 psp
.hInstance
= hApplet
;
107 psp
.pfnDlgProc
= IsConnctedPageDlgProc
;
108 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_ISCONNECTEDPAGE
);
109 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
111 /* Create finish page */
112 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
113 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
114 psp
.hInstance
= hApplet
;
116 psp
.pfnDlgProc
= FinishPageDlgProc
;
117 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_FINISHPAGE
);
118 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
120 /* Create the property sheet */
121 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
122 psh
.dwFlags
= PSH_WIZARD97
| PSH_WATERMARK
| PSH_HEADER
;
123 psh
.hInstance
= hApplet
;
124 psh
.hwndParent
= NULL
;
128 psh
.pszbmWatermark
= MAKEINTRESOURCE(IDB_WATERMARK
);
129 psh
.pszbmHeader
= MAKEINTRESOURCE(IDB_HEADER
);
131 /* Display the wizard */
136 AddHardwareWizard(HWND hwnd
, LPTSTR lpName
)
138 HardwareWizardInit(hwnd
);
141 /* Control Panel Callback */
143 CPlApplet(HWND hwndCpl
,
158 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
160 CPlInfo
->idIcon
= IDI_CPLICON
;
161 CPlInfo
->idName
= IDS_CPLNAME
;
162 CPlInfo
->idInfo
= IDS_CPLDESCRIPTION
;
167 AddHardwareWizard(hwndCpl
, NULL
);
176 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
178 UNREFERENCED_PARAMETER(lpvReserved
);
182 case DLL_PROCESS_ATTACH
: