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 IsConnectedPageDlgProc(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
, DWLP_MSGRESULT
, IDD_NOTCONNECTEDPAGE
);
177 SetWindowLongPtr(hwndDlg
, DWLP_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
, DWLP_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
, DWLP_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
, DWLP_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
, DWLP_MSGRESULT
, IDD_PROGRESSPAGE
);
504 SetWindowLongPtr(hwndDlg
, DWLP_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
, DWLP_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
, DWLP_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
, DWLP_MSGRESULT
, IDD_SELECTWAYPAGE
);
780 PropSheetProc(HWND hwndDlg
, UINT uMsg
, LPARAM lParam
)
782 // NOTE: This callback is needed to set large icon correctly.
786 case PSCB_INITIALIZED
:
788 hIcon
= LoadIconW(hApplet
, MAKEINTRESOURCEW(IDI_CPLICON
));
789 SendMessageW(hwndDlg
, WM_SETICON
, ICON_BIG
, (LPARAM
)hIcon
);
797 HardwareWizardInit(HWND hwnd
)
799 HPROPSHEETPAGE ahpsp
[10];
800 PROPSHEETPAGE psp
= {0};
804 /* Create the Start page, until setup is working */
805 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
806 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
807 psp
.hInstance
= hApplet
;
809 psp
.pfnDlgProc
= StartPageDlgProc
;
810 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_STARTPAGE
);
811 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
813 /* Create search page */
814 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
815 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
816 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SEARCHTITLE
);
817 psp
.pszHeaderSubTitle
= NULL
;
818 psp
.hInstance
= hApplet
;
820 psp
.pfnDlgProc
= SearchPageDlgProc
;
821 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_SEARCHPAGE
);
822 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
824 /* Create is connected page */
825 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
826 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
827 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_ISCONNECTED
);
828 psp
.pszHeaderSubTitle
= NULL
;
829 psp
.hInstance
= hApplet
;
831 psp
.pfnDlgProc
= IsConnectedPageDlgProc
;
832 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_ISCONNECTEDPAGE
);
833 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
835 /* Create probe list page */
836 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
837 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
838 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_PROBELISTTITLE
);
839 psp
.pszHeaderSubTitle
= NULL
;
840 psp
.hInstance
= hApplet
;
842 psp
.pfnDlgProc
= ProbeListPageDlgProc
;
843 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_PROBELISTPAGE
);
844 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
846 /* Create select search way page */
847 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
848 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
849 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SELECTWAYTITLE
);
850 psp
.pszHeaderSubTitle
= NULL
;
851 psp
.hInstance
= hApplet
;
853 psp
.pfnDlgProc
= SelectWayPageDlgProc
;
854 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_SELECTWAYPAGE
);
855 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
857 /* Create device status page */
858 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
859 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
860 psp
.hInstance
= hApplet
;
862 psp
.pfnDlgProc
= DevStatusPageDlgProc
;
863 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_HWSTATUSPAGE
);
864 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
866 /* Create hardware types page */
867 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
868 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
869 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_HDTYPESTITLE
);
870 psp
.pszHeaderSubTitle
= NULL
;
871 psp
.hInstance
= hApplet
;
873 psp
.pfnDlgProc
= HdTypesPageDlgProc
;
874 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_HWTYPESPAGE
);
875 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
877 /* Create progress page */
878 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
879 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
880 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SEARCHTITLE
);
881 psp
.pszHeaderSubTitle
= NULL
;
882 psp
.hInstance
= hApplet
;
884 psp
.pfnDlgProc
= ProgressPageDlgProc
;
885 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_PROGRESSPAGE
);
886 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
888 /* Create finish page */
889 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
890 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
891 psp
.hInstance
= hApplet
;
893 psp
.pfnDlgProc
= FinishPageDlgProc
;
894 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_FINISHPAGE
);
895 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
897 /* Create not connected page */
898 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
899 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
900 psp
.hInstance
= hApplet
;
902 psp
.pfnDlgProc
= NotConnectedPageDlgProc
;
903 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_NOTCONNECTEDPAGE
);
904 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
906 /* Create the property sheet */
907 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
908 psh
.dwFlags
= PSH_WIZARD97
| PSH_WATERMARK
| PSH_HEADER
| PSH_USEICONID
| PSH_USECALLBACK
;
909 psh
.hInstance
= hApplet
;
910 psh
.pszIcon
= MAKEINTRESOURCEW(IDI_CPLICON
);
911 psh
.hwndParent
= hwnd
;
915 psh
.pszbmWatermark
= MAKEINTRESOURCE(IDB_WATERMARK
);
916 psh
.pszbmHeader
= MAKEINTRESOURCE(IDB_HEADER
);
917 psh
.pfnCallback
= PropSheetProc
;
919 /* Create title font */
920 hTitleFont
= CreateTitleFont();
922 /* Display the wizard */
925 DeleteObject(hTitleFont
);
928 /* FUNCTIONS ****************************************************************/
931 InstallNewDevice(HWND hwndParent
, LPGUID ClassGuid
, PDWORD pReboot
)
937 AddHardwareWizard(HWND hwnd
, LPWSTR lpName
)
941 DPRINT1("No support of remote installation yet!\n");
945 HardwareWizardInit(hwnd
);
948 /* Control Panel Callback */
950 CPlApplet(HWND hwndCpl
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
)
962 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
964 CPlInfo
->idIcon
= IDI_CPLICON
;
965 CPlInfo
->idName
= IDS_CPLNAME
;
966 CPlInfo
->idInfo
= IDS_CPLDESCRIPTION
;
971 AddHardwareWizard(hwndCpl
, NULL
);
979 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
981 UNREFERENCED_PARAMETER(lpvReserved
);
985 case DLL_PROCESS_ATTACH
:
987 hProcessHeap
= GetProcessHeap();
988 DisableThreadLibraryCalls(hinstDLL
);