Partially fixed up tree after merge from HEAD. More to do.
[reactos.git] / reactos / dll / cpl / sysdm / hardware.c
1 /*
2 * ReactOS
3 * Copyright (C) 2004 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program 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
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 /* $Id$
20 *
21 * PROJECT: ReactOS System Control Panel
22 * FILE: lib/cpl/system/hardware.c
23 * PURPOSE: Hardware devices
24 * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
25 * UPDATE HISTORY:
26 * 03-04-2004 Created
27 */
28 #include <windows.h>
29 #include <stdlib.h>
30 #include <tchar.h>
31
32 #include "resource.h"
33 #include "sysdm.h"
34
35 typedef BOOL (STDCALL *PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow);
36 BOOL LaunchDeviceManager(HWND hWndParent)
37 {
38 HMODULE hDll;
39 PDEVMGREXEC DevMgrExec;
40 BOOL Ret;
41
42 hDll = LoadLibrary(_TEXT("devmgr.dll"));
43 if(!hDll)
44 return FALSE;
45 DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW");
46 if(!DevMgrExec)
47 {
48 FreeLibrary(hDll);
49 return FALSE;
50 }
51 /* run the Device Manager */
52 Ret = DevMgrExec(hWndParent, hApplet, NULL /* ??? */, SW_SHOW);
53 FreeLibrary(hDll);
54 return Ret;
55 }
56
57 /* Property page dialog callback */
58 INT_PTR CALLBACK
59 HardwarePageProc(
60 HWND hwndDlg,
61 UINT uMsg,
62 WPARAM wParam,
63 LPARAM lParam
64 )
65 {
66 UNREFERENCED_PARAMETER(lParam)
67 switch(uMsg)
68 {
69 case WM_INITDIALOG:
70 break;
71 case WM_COMMAND:
72 switch(LOWORD(wParam))
73 {
74 case IDC_HARDWARE_DEVICE_MANAGER:
75 if(!LaunchDeviceManager(hwndDlg))
76 {
77 /* FIXME */
78 }
79 break;
80 }
81 break;
82 }
83 return FALSE;
84 }
85