- Move NCI generated files to arch-specific directories
[reactos.git] / reactos / dll / cpl / sysdm / hardware.c
1 /*
2 * PROJECT: ReactOS System Control Panel Applet
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/cpl/sysdm/hardware.c
5 * PURPOSE: Hardware devices
6 * COPYRIGHT: Copyright Thomas Weidenmueller <w3seek@reactos.org>
7 * Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
8 *
9 */
10
11 #include "precomp.h"
12
13 typedef BOOL (STDCALL *PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow);
14
15 BOOL LaunchDeviceManager(HWND hWndParent)
16 {
17 HMODULE hDll;
18 PDEVMGREXEC DevMgrExec;
19 BOOL Ret;
20
21 hDll = LoadLibrary(_TEXT("devmgr.dll"));
22 if(!hDll)
23 return FALSE;
24
25 DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW");
26 if(!DevMgrExec)
27 {
28 FreeLibrary(hDll);
29 return FALSE;
30 }
31
32 /* run the Device Manager */
33 Ret = DevMgrExec(hWndParent, hApplet, NULL /* ??? */, SW_SHOW);
34 FreeLibrary(hDll);
35 return Ret;
36 }
37
38 /* Property page dialog callback */
39 INT_PTR CALLBACK
40 HardwarePageProc(HWND hwndDlg,
41 UINT uMsg,
42 WPARAM wParam,
43 LPARAM lParam)
44 {
45 UNREFERENCED_PARAMETER(lParam);
46
47 switch(uMsg)
48 {
49 case WM_INITDIALOG:
50 break;
51
52 case WM_COMMAND:
53 {
54 switch(LOWORD(wParam))
55 {
56 case IDC_HARDWARE_DEVICE_MANAGER:
57 {
58 if(!LaunchDeviceManager(hwndDlg))
59 {
60 /* FIXME */
61 }
62
63 return TRUE;
64 }
65
66 case IDC_HARDWARE_PROFILE:
67 {
68 DialogBox(hApplet,
69 MAKEINTRESOURCE(IDD_HARDWAREPROFILES),
70 hwndDlg,
71 (DLGPROC)HardProfDlgProc);
72
73 return TRUE;
74 }
75 }
76 }
77 break;
78 }
79
80 return FALSE;
81 }
82