start to overhaul sysdm.cpl and make it more like XP's, which is much more user friendly
[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 *
8 */
9
10 #include "precomp.h"
11
12 typedef BOOL (STDCALL *PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow);
13 BOOL LaunchDeviceManager(HWND hWndParent)
14 {
15 HMODULE hDll;
16 PDEVMGREXEC DevMgrExec;
17 BOOL Ret;
18
19 hDll = LoadLibrary(_TEXT("devmgr.dll"));
20 if(!hDll)
21 return FALSE;
22 DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW");
23 if(!DevMgrExec)
24 {
25 FreeLibrary(hDll);
26 return FALSE;
27 }
28 /* run the Device Manager */
29 Ret = DevMgrExec(hWndParent, hApplet, NULL /* ??? */, SW_SHOW);
30 FreeLibrary(hDll);
31 return Ret;
32 }
33
34 /* Property page dialog callback */
35 INT_PTR CALLBACK
36 HardwarePageProc(
37 HWND hwndDlg,
38 UINT uMsg,
39 WPARAM wParam,
40 LPARAM lParam
41 )
42 {
43 UNREFERENCED_PARAMETER(lParam);
44 switch(uMsg)
45 {
46 case WM_INITDIALOG:
47 break;
48 case WM_COMMAND:
49 switch(LOWORD(wParam))
50 {
51 case IDC_HARDWARE_DEVICE_MANAGER:
52 if(!LaunchDeviceManager(hwndDlg))
53 {
54 /* FIXME */
55 }
56 break;
57 }
58 break;
59 }
60 return FALSE;
61 }
62