ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

hardware.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:     ReactOS System Control Panel Applet
00003  * LICENSE:     GPL - See COPYING in the top level directory
00004  * FILE:        dll/cpl/sysdm/hardware.c
00005  * PURPOSE:     Hardware devices
00006  * COPYRIGHT:   Copyright Thomas Weidenmueller <w3seek@reactos.org>
00007  *              Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
00008  *
00009  */
00010 
00011 #include "precomp.h"
00012 
00013 typedef BOOL (WINAPI *PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow);
00014 
00015 static BOOL
00016 LaunchDeviceManager(HWND hWndParent)
00017 {
00018 /* Hack for ROS to start our devmgmt until we have MMC */
00019 #ifdef __REACTOS__
00020     return ((INT_PTR)ShellExecuteW(NULL, L"open", L"devmgmt.exe", NULL, NULL, SW_SHOWNORMAL) > 32);
00021 #else
00022     HMODULE hDll;
00023     PDEVMGREXEC DevMgrExec;
00024     BOOL Ret;
00025 
00026     hDll = LoadLibrary(_TEXT("devmgr.dll"));
00027     if(!hDll)
00028         return FALSE;
00029 
00030     DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW");
00031     if(!DevMgrExec)
00032     {
00033         FreeLibrary(hDll);
00034         return FALSE;
00035     }
00036 
00037     /* Run the Device Manager */
00038     Ret = DevMgrExec(hWndParent, hApplet, NULL /* ??? */, SW_SHOW);
00039     FreeLibrary(hDll);
00040     return Ret;
00041 #endif /* __REACTOS__ */
00042 }
00043 
00044 static VOID
00045 LaunchHardwareWizard(HWND hWndParent)
00046 {
00047     SHELLEXECUTEINFO shInputDll;
00048 
00049     memset(&shInputDll, 0x0, sizeof(SHELLEXECUTEINFO));
00050 
00051     shInputDll.cbSize = sizeof(shInputDll);
00052     shInputDll.hwnd = hWndParent;
00053     shInputDll.lpVerb = _T("open");
00054     shInputDll.lpFile = _T("rundll32.exe");
00055     shInputDll.lpParameters = _T("shell32.dll,Control_RunDLL hdwwiz.cpl");
00056 
00057     if (ShellExecuteEx(&shInputDll) == 0)
00058     {
00059         MessageBox(NULL,
00060                    _T("Can't start hdwwiz.cpl"),
00061                    NULL,
00062                    MB_OK | MB_ICONERROR);
00063     }
00064 }
00065 
00066 /* Property page dialog callback */
00067 INT_PTR CALLBACK
00068 HardwarePageProc(HWND hwndDlg,
00069                  UINT uMsg,
00070                  WPARAM wParam,
00071                  LPARAM lParam)
00072 {
00073     UNREFERENCED_PARAMETER(lParam);
00074 
00075     switch (uMsg)
00076     {
00077         case WM_INITDIALOG:
00078             break;
00079 
00080         case WM_COMMAND:
00081             switch (LOWORD(wParam))
00082             {
00083                 case IDC_HARDWARE_DEVICE_MANAGER:
00084                     if (!LaunchDeviceManager(hwndDlg))
00085                     {
00086                         /* FIXME */
00087                     }
00088                     return TRUE;
00089 
00090                 case IDC_HARDWARE_WIZARD:
00091                     LaunchHardwareWizard(hwndDlg);
00092                     return TRUE;
00093 
00094                 case IDC_HARDWARE_PROFILE:
00095                     DialogBox(hApplet,
00096                               MAKEINTRESOURCE(IDD_HARDWAREPROFILES),
00097                               hwndDlg,
00098                               (DLGPROC)HardProfDlgProc);
00099                     return TRUE;
00100             }
00101             break;
00102     }
00103 
00104     return FALSE;
00105 }

Generated on Sat May 26 2012 04:17:52 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.