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., 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)
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 _tcscpy(LogFont
.lfFaceName
, _T("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 SetWindowLong(hwndDlg
, DWL_MSGRESULT
, IDD_NOTCONNECTEDPAGE
);
177 SetWindowLong(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 SetWindowLong(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
= (LPTSTR
) szBuffer
;
316 (VOID
) ListView_InsertItem(hList
, &Item
);
318 (VOID
) ListView_SetExtendedListViewStyle(hList
, LVS_EX_FULLROWSELECT
);
320 hDevInfo
= SetupDiGetClassDevsEx(NULL
, NULL
, NULL
, DIGCF_ALLCLASSES
| DIGCF_PRESENT
, NULL
, NULL
, 0);
322 if (hDevInfo
== INVALID_HANDLE_VALUE
) return;
324 /* get the device image List */
325 ImageListData
.cbSize
= sizeof(ImageListData
);
326 SetupDiGetClassImageList(&ImageListData
);
328 DevInfoData
.cbSize
= sizeof(SP_DEVINFO_DATA
);
329 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 /* Set device name */
382 Item
.pszText
= (LPWSTR
) szBuffer
;
383 Item
.mask
= LVIF_TEXT
| LVIF_PARAM
| LVIF_IMAGE
;
384 Item
.lParam
= (LPARAM
) pstrStatusText
;
385 Item
.iItem
= (INT
) ListView_GetItemCount(hList
);
386 (VOID
) ListView_InsertItem(hList
, &Item
);
388 DevInfoData
.cbSize
= sizeof(SP_DEVINFO_DATA
);
391 (VOID
) ListView_SetImageList(hList
, ImageListData
.ImageList
, LVSIL_SMALL
);
392 SetupDiDestroyDeviceInfoList(hDevInfo
);
395 static INT_PTR CALLBACK
396 ProbeListPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
404 pDeviceStatusText
= (PWSTR
)HeapAlloc(hProcessHeap
, 0, MAX_STR_SIZE
);
405 InitProbeListPage(hwndDlg
);
417 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
423 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
);
429 Index
= (INT
) SendMessage(GetDlgItem(hwndDlg
, IDC_PROBELIST
), LVM_GETNEXTITEM
, -1, LVNI_FOCUSED
);
432 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
| PSWIZB_NEXT
);
439 Index
= (INT
) SendMessage(GetDlgItem(hwndDlg
, IDC_PROBELIST
), LVM_GETNEXTITEM
, -1, LVNI_FOCUSED
);
444 SetWindowLong(hwndDlg
, DWL_MSGRESULT
, IDD_SELECTWAYPAGE
);
451 ZeroMemory(&Item
, sizeof(LV_ITEM
));
452 Item
.mask
= LVIF_PARAM
;
454 (VOID
) ListView_GetItem(GetDlgItem(hwndDlg
, IDC_PROBELIST
), &Item
);
455 pts
= (PWSTR
) Item
.lParam
;
456 wcscpy(pDeviceStatusText
, pts
);
458 SetWindowLong(hwndDlg
, DWL_MSGRESULT
, IDD_HWSTATUSPAGE
);
472 for (Index
= ListView_GetItemCount(GetDlgItem(hwndDlg
, IDC_PROBELIST
)); --Index
> 0;)
474 ZeroMemory(&Item
, sizeof(LV_ITEM
));
475 Item
.mask
= LVIF_PARAM
;
477 (VOID
) ListView_GetItem(GetDlgItem(hwndDlg
, IDC_PROBELIST
), &Item
);
478 HeapFree(hProcessHeap
, 0, (LPVOID
) Item
.lParam
);
480 HeapFree(hProcessHeap
, 0, (LPVOID
) pDeviceStatusText
);
488 static INT_PTR CALLBACK
489 SelectWayPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
495 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
501 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_NEXT
| PSWIZB_BACK
);
502 if (SendDlgItemMessage(hwndDlg
, IDC_AUTOINSTALL
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
503 SendDlgItemMessage(hwndDlg
, IDC_MANUALLYINST
, BM_SETCHECK
, 0, 0);
506 SendDlgItemMessage(hwndDlg
, IDC_AUTOINSTALL
, BM_SETCHECK
, 1, 1);
507 SendDlgItemMessage(hwndDlg
, IDC_MANUALLYINST
, BM_SETCHECK
, 0, 0);
514 if (SendDlgItemMessage(hwndDlg
, IDC_AUTOINSTALL
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
515 SetWindowLong(hwndDlg
, DWL_MSGRESULT
, IDD_PROGRESSPAGE
);
517 SetWindowLong(hwndDlg
, DWL_MSGRESULT
, IDD_HWTYPESPAGE
);
529 static INT_PTR CALLBACK
530 DevStatusPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
537 SendDlgItemMessage(hwndDlg
, IDC_FINISHTITLE
, WM_SETFONT
, (WPARAM
)hTitleFont
, (LPARAM
)TRUE
);
538 /* Set status text */
539 SetWindowText(GetDlgItem(hwndDlg
, IDC_HWSTATUSEDIT
), pDeviceStatusText
);
545 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
551 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_FINISH
| PSWIZB_BACK
);
557 SetWindowLong(hwndDlg
, DWL_MSGRESULT
, IDD_PROBELISTPAGE
);
569 EnumDeviceClasses(INT ClassIndex
,
577 WCHAR ClassName
[MAX_STR_SIZE
];
578 DWORD RequiredSize
= MAX_STR_SIZE
;
582 *DevClassName
= L
'\0';
584 Ret
= CM_Enumerate_Classes(ClassIndex
,
587 if (Ret
!= CR_SUCCESS
)
589 /* all classes enumerated */
590 if(Ret
== CR_NO_SUCH_VALUE
)
592 hDevInfoTypes
= NULL
;
596 if (Ret
== CR_INVALID_DATA
)
598 ; /*FIXME: what should we do here? */
601 /* handle other errors... */
604 if (SetupDiClassNameFromGuid(&ClassGuid
,
609 lstrcpy(DevClassName
, ClassName
);
612 if (!SetupDiGetClassImageIndex(&ImageListData
,
616 /* FIXME: can we do this?
617 * Set the blank icon: IDI_SETUPAPI_BLANK = 41
618 * it'll be image 24 in the imagelist */
622 /* Get device info for all devices of a particular class */
623 hDevInfoTypes
= SetupDiGetClassDevs(&ClassGuid
,
627 if (hDevInfoTypes
== INVALID_HANDLE_VALUE
)
629 hDevInfoTypes
= NULL
;
633 KeyClass
= SetupDiOpenClassRegKeyEx(&ClassGuid
,
638 if (KeyClass
!= INVALID_HANDLE_VALUE
)
641 LONG dwSize
= MAX_STR_SIZE
;
643 if (RegQueryValue(KeyClass
,
646 &dwSize
) != ERROR_SUCCESS
)
648 *DevClassDesc
= L
'\0';
658 RegCloseKey(KeyClass
);
664 InitHardWareTypesPage(HWND hwndDlg
)
666 HWND hList
= GetDlgItem(hwndDlg
, IDC_HWTYPESLIST
);
667 WCHAR DevName
[MAX_STR_SIZE
];
668 WCHAR DevDesc
[MAX_STR_SIZE
];
669 BOOL DevExist
= FALSE
;
670 INT ClassRet
, DevImage
, Index
= 0;
677 ZeroMemory(&Column
, sizeof(LV_COLUMN
));
679 GetClientRect(hList
, &Rect
);
681 Column
.mask
= LVCF_FMT
| LVCF_TEXT
| LVCF_WIDTH
;
682 Column
.fmt
= LVCFMT_LEFT
;
684 Column
.pszText
= NULL
;
685 Column
.cx
= Rect
.right
- GetSystemMetrics(SM_CXVSCROLL
);
686 (VOID
) ListView_InsertColumn(hList
, 0, &Column
);
688 ZeroMemory(&Item
, sizeof(LV_ITEM
));
692 ClassRet
= EnumDeviceClasses(Index
,
698 if ((ClassRet
!= -1) && (DevExist
))
700 Item
.mask
= LVIF_TEXT
| LVIF_PARAM
| LVIF_STATE
| LVIF_IMAGE
;
702 Item
.iImage
= DevImage
;
704 if (DevDesc
[0] != L
'\0')
705 Item
.pszText
= (LPWSTR
) DevDesc
;
707 Item
.pszText
= (LPWSTR
) DevName
;
709 (VOID
) ListView_InsertItem(hList
, &Item
);
711 /* kill InfoList initialized in EnumDeviceClasses */
714 SetupDiDestroyDeviceInfoList(hDevInfoTypes
);
715 hDevInfoTypes
= NULL
;
720 while (ClassRet
!= -1);
722 (VOID
) ListView_SetImageList(hList
, ImageListData
.ImageList
, LVSIL_SMALL
);
725 static INT_PTR CALLBACK
726 HdTypesPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
732 InitHardWareTypesPage(hwndDlg
);
738 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
744 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
);
750 SetWindowLong(hwndDlg
, DWL_MSGRESULT
, IDD_SELECTWAYPAGE
);
761 static INT_PTR CALLBACK
762 ProgressPageDlgProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
768 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
774 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
);
780 SetWindowLong(hwndDlg
, DWL_MSGRESULT
, IDD_SELECTWAYPAGE
);
792 HardwareWizardInit(HWND hwnd
)
794 HPROPSHEETPAGE ahpsp
[10];
795 PROPSHEETPAGE psp
= {0};
799 /* Create the Start page, until setup is working */
800 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
801 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
802 psp
.hInstance
= hApplet
;
804 psp
.pfnDlgProc
= StartPageDlgProc
;
805 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_STARTPAGE
);
806 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
808 /* Create search page */
809 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
810 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
811 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SEARCHTITLE
);
812 psp
.pszHeaderSubTitle
= NULL
;
813 psp
.hInstance
= hApplet
;
815 psp
.pfnDlgProc
= SearchPageDlgProc
;
816 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_SEARCHPAGE
);
817 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
819 /* Create is connected page */
820 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
821 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
822 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_ISCONNECTED
);
823 psp
.pszHeaderSubTitle
= NULL
;
824 psp
.hInstance
= hApplet
;
826 psp
.pfnDlgProc
= IsConnctedPageDlgProc
;
827 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_ISCONNECTEDPAGE
);
828 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
830 /* Create probe list page */
831 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
832 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
833 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_PROBELISTTITLE
);
834 psp
.pszHeaderSubTitle
= NULL
;
835 psp
.hInstance
= hApplet
;
837 psp
.pfnDlgProc
= ProbeListPageDlgProc
;
838 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_PROBELISTPAGE
);
839 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
841 /* Create select search way page */
842 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
843 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
844 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SELECTWAYTITLE
);
845 psp
.pszHeaderSubTitle
= NULL
;
846 psp
.hInstance
= hApplet
;
848 psp
.pfnDlgProc
= SelectWayPageDlgProc
;
849 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_SELECTWAYPAGE
);
850 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
852 /* Create device status page */
853 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
854 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
855 psp
.hInstance
= hApplet
;
857 psp
.pfnDlgProc
= DevStatusPageDlgProc
;
858 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_HWSTATUSPAGE
);
859 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
861 /* Create hardware types page */
862 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
863 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
864 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_HDTYPESTITLE
);
865 psp
.pszHeaderSubTitle
= NULL
;
866 psp
.hInstance
= hApplet
;
868 psp
.pfnDlgProc
= HdTypesPageDlgProc
;
869 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_HWTYPESPAGE
);
870 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
872 /* Create progress page */
873 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
874 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
875 psp
.pszHeaderTitle
= MAKEINTRESOURCE(IDS_SEARCHTITLE
);
876 psp
.pszHeaderSubTitle
= NULL
;
877 psp
.hInstance
= hApplet
;
879 psp
.pfnDlgProc
= ProgressPageDlgProc
;
880 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_PROGRESSPAGE
);
881 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
883 /* Create finish page */
884 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
885 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
886 psp
.hInstance
= hApplet
;
888 psp
.pfnDlgProc
= FinishPageDlgProc
;
889 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_FINISHPAGE
);
890 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
892 /* Create not connected page */
893 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
894 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
895 psp
.hInstance
= hApplet
;
897 psp
.pfnDlgProc
= NotConnectedPageDlgProc
;
898 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_NOTCONNECTEDPAGE
);
899 ahpsp
[nPages
++] = CreatePropertySheetPage(&psp
);
901 /* Create the property sheet */
902 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
903 psh
.dwFlags
= PSH_WIZARD97
| PSH_WATERMARK
| PSH_HEADER
;
904 psh
.hInstance
= hApplet
;
905 psh
.hwndParent
= hwnd
;
909 psh
.pszbmWatermark
= MAKEINTRESOURCE(IDB_WATERMARK
);
910 psh
.pszbmHeader
= MAKEINTRESOURCE(IDB_HEADER
);
912 /* Create title font */
913 hTitleFont
= CreateTitleFont();
915 /* Display the wizard */
918 DeleteObject(hTitleFont
);
921 /* FUNCTIONS ****************************************************************/
924 InstallNewDevice(HWND hwndParent
, LPGUID ClassGuid
, PDWORD pReboot
)
930 AddHardwareWizard(HWND hwnd
, LPWSTR lpName
)
934 DPRINT1("No support of remote installation yet!\n");
938 HardwareWizardInit(hwnd
);
941 /* Control Panel Callback */
943 CPlApplet(HWND hwndCpl
, UINT uMsg
, LPARAM lParam1
, LPARAM lParam2
)
955 CPLINFO
*CPlInfo
= (CPLINFO
*)lParam2
;
957 CPlInfo
->idIcon
= IDI_CPLICON
;
958 CPlInfo
->idName
= IDS_CPLNAME
;
959 CPlInfo
->idInfo
= IDS_CPLDESCRIPTION
;
964 AddHardwareWizard(hwndCpl
, NULL
);
972 DllMain(HINSTANCE hinstDLL
, DWORD dwReason
, LPVOID lpvReserved
)
974 UNREFERENCED_PARAMETER(lpvReserved
);
978 case DLL_PROCESS_ATTACH
:
980 hProcessHeap
= GetProcessHeap();
981 DisableThreadLibraryCalls(hinstDLL
);