ef329b3b2992b730a0ac1a2f83681440ae702425
[reactos.git] / reactos / lib / 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: hardware.c,v 1.1 2004/03/08 14:24:47 weiden Exp $
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 "resource.h"
31 #include "sysdm.h"
32
33 typedef WINBOOL (STDCALL *PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow);
34 BOOL LaunchDeviceManager(HWND hWndParent)
35 {
36 HMODULE hDll;
37 PDEVMGREXEC DevMgrExec;
38 BOOL Ret;
39
40 if(!(hDll = LoadLibrary(L"devmgr.dll")))
41 {
42 return FALSE;
43 }
44 if(!(DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW")))
45 {
46 FreeLibrary(hDll);
47 return FALSE;
48 }
49 /* run the Device Manager */
50 Ret = DevMgrExec(hWndParent, hApplet, NULL /* ??? */, SW_SHOW);
51 FreeLibrary(hDll);
52 return Ret;
53 }
54
55 /* Property page dialog callback */
56 BOOL CALLBACK
57 HardwarePageProc(
58 HWND hwndDlg,
59 UINT uMsg,
60 WPARAM wParam,
61 LPARAM lParam
62 )
63 {
64 switch(uMsg)
65 {
66 case WM_INITDIALOG:
67 break;
68 case WM_COMMAND:
69 switch(LOWORD(wParam))
70 {
71 case IDC_DEVMGR:
72 if(!LaunchDeviceManager(hwndDlg))
73 {
74 /* FIXME */
75 }
76 break;
77 }
78 break;
79 }
80 return FALSE;
81 }
82