reshuffling of dlls
[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 if(!(hDll = LoadLibrary(_TEXT("devmgr.dll"))))
43 {
44 return FALSE;
45 }
46 if(!(DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW")))
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 switch(uMsg)
67 {
68 case WM_INITDIALOG:
69 break;
70 case WM_COMMAND:
71 switch(LOWORD(wParam))
72 {
73 case IDC_HARDWARE_DEVICE_MANAGER:
74 if(!LaunchDeviceManager(hwndDlg))
75 {
76 /* FIXME */
77 }
78 break;
79 }
80 break;
81 }
82 return FALSE;
83 }
84