2 * ReactOS New devices installation
3 * Copyright (C) 2005, 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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)
30 /* GLOBALS ******************************************************************/
32 HINSTANCE hApplet
= NULL
;
34 SP_CLASSIMAGELIST_DATA ImageListData
;
35 PWSTR pDeviceStatusText
;
37 HDEVINFO hDevInfoTypes
;
39 typedef BOOL (WINAPI
*PINSTALL_NEW_DEVICE
)(HWND
, LPGUID
, PDWORD
);
42 /* STATIC FUNCTIONS *********************************************************/
53 ncm
.cbSize
= sizeof(NONCLIENTMETRICS
);
54 SystemParametersInfo(SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0);
56 LogFont
= ncm
.lfMessageFont
;
57 LogFont
.lfWeight
= FW_BOLD
;
58 wcscpy(LogFont
.lfFaceName
, L
"MS Shell Dlg");
62 LogFont
.lfHeight
= 0 - GetDeviceCaps (hdc
, LOGPIXELSY
) * FontSize
/ 72;
63 hFont
= CreateFontIndirect(&LogFont
);
69 static INT_PTR CALLBACK
70 StartPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
77 SendDlgItemMessage(hwndDlg
, IDC_FINISHTITLE
, WM_SETFONT
, (WPARAM
)hTitleFont
, (LPARAM
)TRUE
);
83 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
89 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_NEXT
);
100 static INT_PTR CALLBACK
101 SearchPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
107 /* TODO: PnP devices search */
113 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
119 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_NEXT
| PSWIZB_BACK
);
130 static INT_PTR CALLBACK
131 IsConnctedPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
137 if(HIWORD(wParam
) == BN_CLICKED
)
139 if ((SendDlgItemMessage(hwndDlg
, IDC_CONNECTED
, BM_GETCHECK
, 0, 0) == BST_CHECKED
) ||
140 (SendDlgItemMessage(hwndDlg
, IDC_NOTCONNECTED
, BM_GETCHECK
, 0, 0) == BST_CHECKED
))
142 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_NEXT
| PSWIZB_BACK
);
146 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
);
154 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
160 if ((SendDlgItemMessage(hwndDlg
, IDC_CONNECTED
, BM_GETCHECK
, 0, 0) == BST_CHECKED
) ||
161 (SendDlgItemMessage(hwndDlg
, IDC_NOTCONNECTED
, BM_GETCHECK
, 0, 0) == BST_CHECKED
))
163 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_NEXT
| PSWIZB_BACK
);
167 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
);
174 if (SendDlgItemMessage(hwndDlg
, IDC_NOTCONNECTED
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
175 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_NOTCONNECTEDPAGE
);
177 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_PROBELISTPAGE
);
189 static INT_PTR CALLBACK
190 FinishPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
197 SendDlgItemMessage(hwndDlg
, IDC_FINISHTITLE
, WM_SETFONT
, (WPARAM
)hTitleFont
, (LPARAM
)TRUE
);
203 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
209 /* Only "Finish" button */
210 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_FINISH
);
221 static INT_PTR CALLBACK
222 NotConnectedPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
229 SendDlgItemMessage(hwndDlg
, IDC_FINISHTITLE
, WM_SETFONT
, (WPARAM
)hTitleFont
, (LPARAM
)TRUE
);
235 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
241 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_FINISH
| PSWIZB_BACK
);
247 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_ISCONNECTEDPAGE
);
259 TrimGuidString(LPWSTR szString
, LPWSTR szNewString
)
264 if (wcslen(szString
) == 38)
266 if ((szString
[0] == L
'{') && (szString
[37] == L
'}'))
268 for (Index
= 0; Index
< wcslen(szString
); Index
++)
269 szBuffer
[Index
] = szString
[Index
+ 1];
271 szBuffer
[36] = L
'\0';
272 wcscpy(szNewString
, szBuffer
);
276 wcscpy(szNewString
, L
"\0");
280 InitProbeListPage(HWND hwndDlg
)
284 WCHAR szBuffer
[MAX_STR_SIZE
], szGuid
[MAX_STR_SIZE
],
285 szTrimGuid
[MAX_STR_SIZE
], szStatusText
[MAX_STR_SIZE
];
286 HWND hList
= GetDlgItem(hwndDlg
, IDC_PROBELIST
);
287 PWSTR pstrStatusText
;
289 SP_DEVINFO_DATA DevInfoData
;
290 ULONG ulStatus
, ulProblemNumber
;
297 ZeroMemory(&Column
, sizeof(LV_COLUMN
));
299 GetClientRect(hList
, &Rect
);
301 Column
.mask
= LVCF_FMT
| LVCF_TEXT
| LVCF_WIDTH
;
302 Column
.fmt
= LVCFMT_LEFT
;
304 Column
.pszText
= NULL
;
305 Column
.cx
= Rect
.right
- GetSystemMetrics(SM_CXVSCROLL
);
306 (VOID
) ListView_InsertColumn(hList
, 0, &Column
);
308 ZeroMemory(&Item
, sizeof(LV_ITEM
));
310 LoadString(hApplet
, IDS_ADDNEWDEVICE
, szBuffer
, sizeof(szBuffer
) / sizeof(WCHAR
));
312 Item
.mask
= LVIF_TEXT
| LVIF_PARAM
| LVIF_STATE
| LVIF_IMAGE
;
313 Item
.pszText
= (LPWSTR
) szBuffer
;
314 Item
.iItem
= (INT
) ListView_GetItemCount(hList
);
316 (VOID
) ListView_InsertItem(hList
, &Item
);
318 hDevInfo
= SetupDiGetClassDevsEx(NULL
, NULL
, NULL
, DIGCF_ALLCLASSES
| DIGCF_PRESENT
, NULL
, NULL
, 0);
320 if (hDevInfo
== INVALID_HANDLE_VALUE
) return;
322 /* get the device image List */
323 ImageListData
.cbSize
= sizeof(ImageListData
);
324 SetupDiGetClassImageList(&ImageListData
);
326 DevInfoData
.cbSize
= sizeof(SP_DEVINFO_DATA
);
327 for (Index
= 0; TRUE
; Index
++)
331 if (!SetupDiEnumDeviceInfo(hDevInfo
, Index
, &DevInfoData
)) break;
333 if (CM_Get_DevNode_Status_Ex(&ulStatus
, &ulProblemNumber
, DevInfoData
.DevInst
, 0, NULL
) == CR_SUCCESS
)
335 if (ulStatus
& DN_NO_SHOW_IN_DM
) continue;
338 /* get the device's friendly name */
339 if (!SetupDiGetDeviceRegistryProperty(hDevInfo
,
347 /* if the friendly name fails, try the description instead */
348 SetupDiGetDeviceRegistryProperty(hDevInfo
,
357 SetupDiGetDeviceRegistryProperty(hDevInfo
,
365 TrimGuidString(szGuid
, szTrimGuid
);
366 UuidFromStringW(szTrimGuid
, &ClassGuid
);
368 SetupDiGetClassImageIndex(&ImageListData
,
372 DeviceProblemTextW(NULL
,
376 sizeof(szStatusText
) / sizeof(WCHAR
));
378 pstrStatusText
= (PWSTR
)HeapAlloc(hProcessHeap
, 0, sizeof(szStatusText
));
379 lstrcpy(pstrStatusText
, szStatusText
);
381 if (szBuffer
[0] != L
'\0')
383 /* Set device name */
384 Item
.pszText
= (LPWSTR
) szBuffer
;
385 Item
.mask
= LVIF_TEXT
| LVIF_PARAM
| LVIF_STATE
| LVIF_IMAGE
;
386 Item
.lParam
= (LPARAM
) pstrStatusText
;
387 Item
.iItem
= (INT
) ListView_GetItemCount(hList
);
388 (VOID
) ListView_InsertItem(hList
, &Item
);
391 DevInfoData
.cbSize
= sizeof(SP_DEVINFO_DATA
);
394 (VOID
) ListView_SetImageList(hList
, ImageListData
.ImageList
, LVSIL_SMALL
);
395 (VOID
) ListView_SetExtendedListViewStyle(hList
, LVS_EX_FULLROWSELECT
);
396 SetupDiDestroyDeviceInfoList(hDevInfo
);
399 static INT_PTR CALLBACK
400 ProbeListPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
408 pDeviceStatusText
= (PWSTR
)HeapAlloc(hProcessHeap
, 0, MAX_STR_SIZE
);
409 InitProbeListPage(hwndDlg
);
415 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
421 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
| PSWIZB_NEXT
);
427 Index
= (INT
) SendMessage(GetDlgItem(hwndDlg
, IDC_PROBELIST
), LVM_GETNEXTITEM
, -1, LVNI_FOCUSED
);
428 if (Index
== -1) Index
= 0;
432 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_SELECTWAYPAGE
);
439 ZeroMemory(&Item
, sizeof(LV_ITEM
));
440 Item
.mask
= LVIF_PARAM
;
442 (VOID
) ListView_GetItem(GetDlgItem(hwndDlg
, IDC_PROBELIST
), &Item
);
443 pts
= (PWSTR
) Item
.lParam
;
444 wcscpy(pDeviceStatusText
, pts
);
446 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_HWSTATUSPAGE
);
459 for (Index
= ListView_GetItemCount(GetDlgItem(hwndDlg
, IDC_PROBELIST
)); --Index
> 0;)
461 ZeroMemory(&Item
, sizeof(LV_ITEM
));
462 Item
.mask
= LVIF_PARAM
;
464 (VOID
) ListView_GetItem(GetDlgItem(hwndDlg
, IDC_PROBELIST
), &Item
);
465 HeapFree(hProcessHeap
, 0, (LPVOID
) Item
.lParam
);
467 HeapFree(hProcessHeap
, 0, (LPVOID
) pDeviceStatusText
);
475 static INT_PTR CALLBACK
476 SelectWayPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
482 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
488 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_NEXT
| PSWIZB_BACK
);
489 if (SendDlgItemMessage(hwndDlg
, IDC_AUTOINSTALL
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
490 SendDlgItemMessage(hwndDlg
, IDC_MANUALLYINST
, BM_SETCHECK
, 0, 0);
493 SendDlgItemMessage(hwndDlg
, IDC_AUTOINSTALL
, BM_SETCHECK
, 1, 1);
494 SendDlgItemMessage(hwndDlg
, IDC_MANUALLYINST
, BM_SETCHECK
, 0, 0);
501 if (SendDlgItemMessage(hwndDlg
, IDC_AUTOINSTALL
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
502 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_PROGRESSPAGE
);
504 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_HWTYPESPAGE
);
516 static INT_PTR CALLBACK
517 DevStatusPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
524 SendDlgItemMessage(hwndDlg
, IDC_FINISHTITLE
, WM_SETFONT
, (WPARAM
)hTitleFont
, (LPARAM
)TRUE
);
530 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
536 /* Set status text */
537 SetWindowText(GetDlgItem(hwndDlg
, IDC_HWSTATUSEDIT
), pDeviceStatusText
);
539 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_FINISH
| PSWIZB_BACK
);
545 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_PROBELISTPAGE
);
557 EnumDeviceClasses(INT ClassIndex
,
565 WCHAR ClassName
[MAX_STR_SIZE
];
566 DWORD RequiredSize
= MAX_STR_SIZE
;
570 *DevClassName
= L
'\0';
572 Ret
= CM_Enumerate_Classes(ClassIndex
,
575 if (Ret
!= CR_SUCCESS
)
577 /* all classes enumerated */
578 if(Ret
== CR_NO_SUCH_VALUE
)
580 hDevInfoTypes
= NULL
;
584 if (Ret
== CR_INVALID_DATA
)
586 ; /*FIXME: what should we do here? */
589 /* handle other errors... */
592 if (SetupDiClassNameFromGuid(&ClassGuid
,
597 lstrcpy(DevClassName
, ClassName
);
600 if (!SetupDiGetClassImageIndex(&ImageListData
,
604 /* FIXME: can we do this?
605 * Set the blank icon: IDI_SETUPAPI_BLANK = 41
606 * it'll be image 24 in the imagelist */
610 /* Get device info for all devices of a particular class */
611 hDevInfoTypes
= SetupDiGetClassDevs(&ClassGuid
,
615 if (hDevInfoTypes
== INVALID_HANDLE_VALUE
)
617 hDevInfoTypes
= NULL
;
621 KeyClass
= SetupDiOpenClassRegKeyEx(&ClassGuid
,
626 if (KeyClass
!= INVALID_HANDLE_VALUE
)
629 LONG dwSize
= MAX_STR_SIZE
;
631 if (RegQueryValue(KeyClass
,
634 &dwSize
) != ERROR_SUCCESS
)
636 *DevClassDesc
= L
'\0';
646 RegCloseKey(KeyClass
);
652 InitHardWareTypesPage(HWND hwndDlg
)
654 HWND hList
= GetDlgItem(hwndDlg
, IDC_HWTYPESLIST
);
655 WCHAR DevName
[MAX_STR_SIZE
];
656 WCHAR DevDesc
[MAX_STR_SIZE
];
657 BOOL DevExist
= FALSE
;
658 INT ClassRet
, DevImage
, Index
= 0;
665 ZeroMemory(&Column
, sizeof(LV_COLUMN
));
667 GetClientRect(hList
, &Rect
);
669 Column
.mask
= LVCF_FMT
| LVCF_TEXT
| LVCF_WIDTH
;
670 Column
.fmt
= LVCFMT_LEFT
;
672 Column
.pszText
= NULL
;
673 Column
.cx
= Rect
.right
- GetSystemMetrics(SM_CXVSCROLL
);
674 (VOID
) ListView_InsertColumn(hList
, 0, &Column
);
676 ZeroMemory(&Item
, sizeof(LV_ITEM
));
680 ClassRet
= EnumDeviceClasses(Index
,
686 if ((ClassRet
!= -1) && (DevExist
))
688 Item
.mask
= LVIF_TEXT
| LVIF_PARAM
| LVIF_STATE
| LVIF_IMAGE
;
690 Item
.iImage
= DevImage
;
692 if (DevDesc
[0] != L
'\0')
693 Item
.pszText
= (LPWSTR
) DevDesc
;
695 Item
.pszText
= (LPWSTR
) DevName
;
697 (VOID
) ListView_InsertItem(hList
, &Item
);
699 /* kill InfoList initialized in EnumDeviceClasses */
702 SetupDiDestroyDeviceInfoList(hDevInfoTypes
);
703 hDevInfoTypes
= NULL
;
708 while (ClassRet
!= -1);
710 (VOID
) ListView_SetImageList(hList
, ImageListData
.ImageList
, LVSIL_SMALL
);
713 static INT_PTR CALLBACK
714 HdTypesPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
720 InitHardWareTypesPage(hwndDlg
);
726 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
732 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
);
738 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_SELECTWAYPAGE
);
749 static INT_PTR CALLBACK
750 ProgressPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
756 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
762 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
);
768 SetWindowLongPtr(hwndDlg
, DWL_MSGRESULT
, IDD_SELECTWAYPAGE
);
780 HardwareWizardInit(HWND hwnd
)
782 HPROPSHEETPAGE ahpsp
[10];
783 PROPSHEETPAGE psp
= {0};
787 /* Create the Start page, until setup is working */
788 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
789 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
790 psp
.hInstance
= hApplet
;
792 psp
.pfnDlgProc
= StartPageDlgProc
;
793 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_STARTPAGE
);
794 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
796 /* Create search page */
797 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
798 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
799 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SEARCHTITLE
);
800 psp
.pszHeaderSubTitle
= NULL
;
801 psp
.hInstance
= hApplet
;
803 psp
.pfnDlgProc
= SearchPageDlgProc
;
804 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_SEARCHPAGE
);
805 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
807 /* Create is connected page */
808 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
809 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
810 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_ISCONNECTED
);
811 psp
.pszHeaderSubTitle
= NULL
;
812 psp
.hInstance
= hApplet
;
814 psp
.pfnDlgProc
= IsConnctedPageDlgProc
;
815 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_ISCONNECTEDPAGE
);
816 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
818 /* Create probe list page */
819 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
820 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
821 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_PROBELISTTITLE
);
822 psp
.pszHeaderSubTitle
= NULL
;
823 psp
.hInstance
= hApplet
;
825 psp
.pfnDlgProc
= ProbeListPageDlgProc
;
826 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_PROBELISTPAGE
);
827 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
829 /* Create select search way page */
830 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
831 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
832 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SELECTWAYTITLE
);
833 psp
.pszHeaderSubTitle
= NULL
;
834 psp
.hInstance
= hApplet
;
836 psp
.pfnDlgProc
= SelectWayPageDlgProc
;
837 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_SELECTWAYPAGE
);
838 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
840 /* Create device status page */
841 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
842 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
843 psp
.hInstance
= hApplet
;
845 psp
.pfnDlgProc
= DevStatusPageDlgProc
;
846 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_HWSTATUSPAGE
);
847 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
849 /* Create hardware types page */
850 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
851 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
852 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_HDTYPESTITLE
);
853 psp
.pszHeaderSubTitle
= NULL
;
854 psp
.hInstance
= hApplet
;
856 psp
.pfnDlgProc
= HdTypesPageDlgProc
;
857 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_HWTYPESPAGE
);
858 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
860 /* Create progress page */
861 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
862 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
863 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SEARCHTITLE
);
864 psp
.pszHeaderSubTitle
= NULL
;
865 psp
.hInstance
= hApplet
;
867 psp
.pfnDlgProc
= ProgressPageDlgProc
;
868 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_PROGRESSPAGE
);
869 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
871 /* Create finish page */
872 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
873 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
874 psp
.hInstance
= hApplet
;
876 psp
.pfnDlgProc
= FinishPageDlgProc
;
877 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_FINISHPAGE
);
878 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
880 /* Create not connected page */
881 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
882 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
883 psp
.hInstance
= hApplet
;
885 psp
.pfnDlgProc
= NotConnectedPageDlgProc
;
886 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_NOTCONNECTEDPAGE
);
887 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
889 /* Create the property sheet */
890 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
891 psh
.dwFlags
= PSH_WIZARD97
| PSH_WATERMARK
| PSH_HEADER
;
892 psh
.hInstance
= hApplet
;
893 psh
.hwndParent
= hwnd
;
897 psh
.pszbmWatermark
= MAKEINTRESOURCE(IDB_WATERMARK
);
898 psh
.pszbmHeader
= MAKEINTRESOURCE(IDB_HEADER
);
900 /* Create title font */
901 hTitleFont
= CreateTitleFont();
903 /* Display the wizard */
906 DeleteObject(hTitleFont
);
909 /* FUNCTIONS ****************************************************************/
912 InstallNewDevice(HWND hwndParent
, LPGUID ClassGuid
, PDWORD pReboot
)
918 AddHardwareWizard(HWND hwnd
, LPWSTR lpName
)
922 DPRINT1("No support of remote installation yet!\n");
926 HardwareWizardInit(hwnd
);
929 /* Control Panel Callback */
931 CPlApplet(HWND hwndCpl
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
)
943 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
945 CPlInfo
->idIcon
= IDI_CPLICON
;
946 CPlInfo
->idName
= IDS_CPLNAME
;
947 CPlInfo
->idInfo
= IDS_CPLDESCRIPTION
;
952 AddHardwareWizard(hwndCpl
, NULL
);
960 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
962 UNREFERENCED_PARAMETER(lpvReserved
);
966 case DLL_PROCESS_ATTACH
:
968 hProcessHeap
= GetProcessHeap();
969 DisableThreadLibraryCalls(hinstDLL
);