display the hardware tab
authorThomas Bluemel <thomas@reactsoft.com>
Fri, 25 Nov 2005 17:02:18 +0000 (17:02 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Fri, 25 Nov 2005 17:02:18 +0000 (17:02 +0000)
svn path=/trunk/; revision=19561

reactos/lib/cpl/main/En.rc
reactos/lib/cpl/main/keyboard.c
reactos/lib/cpl/main/main.c
reactos/lib/cpl/main/main.h
reactos/lib/cpl/main/main.xml
reactos/lib/cpl/main/mouse.c
reactos/lib/cpl/main/resource.h

index 36f3ce2..922651f 100644 (file)
@@ -24,6 +24,21 @@ BEGIN
   LTEXT "Property Page 3",-1,73,74,90,8
 END
 
+IDD_KEYBSPEED DIALOGEX 0, 0, 246, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Speed"
+FONT 8, "MS Shell Dlg"
+BEGIN
+  LTEXT "Keyboard Speed Page",-1,73,74,90,8
+END
+
+IDD_HARDWARE DIALOGEX 0, 0, 246, 228
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Hardware"
+FONT 8, "MS Shell Dlg"
+BEGIN
+END
+
 STRINGTABLE
 BEGIN
   IDS_CPLNAME_1 "Mouse"
index 41a6d9e..58160c4 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include <windows.h>
+#include <devguid.h>
 #include <commctrl.h>
 #include <prsht.h>
 #include <cpl.h>
 
 /* Property page dialog callback */
 static INT_PTR CALLBACK
-Page1Proc(HWND hwndDlg,
-         UINT uMsg,
-         WPARAM wParam,
-         LPARAM lParam)
+KeybSpeedProc(IN HWND hwndDlg,
+             IN UINT uMsg,
+             IN WPARAM wParam,
+             IN LPARAM lParam)
 {
-  switch(uMsg)
-  {
-    case WM_INITDIALOG:
-      break;
-  }
-  return FALSE;
+    switch(uMsg)
+    {
+        case WM_INITDIALOG:
+            break;
+    }
+
+    return FALSE;
 }
 
 
 /* Property page dialog callback */
 static INT_PTR CALLBACK
-Page2Proc(HWND hwndDlg,
-         UINT uMsg,
-         WPARAM wParam,
-         LPARAM lParam)
+KeybHardwareProc(IN HWND hwndDlg,
+                IN UINT uMsg,
+                IN WPARAM wParam,
+                IN LPARAM lParam)
 {
-  switch(uMsg)
-  {
-    case WM_INITDIALOG:
-      break;
-  }
-  return FALSE;
-}
+    switch(uMsg)
+    {
+        case WM_INITDIALOG:
+        {
+            GUID Guids[] = {
+                GUID_DEVCLASS_KEYBOARD
+            };
 
+            /* create the hardware page */
+            DeviceCreateHardwarePageEx(hwndDlg,
+                                       Guids,
+                                       sizeof(Guids) / sizeof(Guids[0]),
+                                       HWPD_STANDARDLIST);
+            break;
+        }
+    }
 
-/* Property page dialog callback */
-static INT_PTR CALLBACK
-Page3Proc(HWND hwndDlg,
-         UINT uMsg,
-         WPARAM wParam,
-         LPARAM lParam)
-{
-  switch(uMsg)
-  {
-    case WM_INITDIALOG:
-      break;
-  }
-  return FALSE;
+    return FALSE;
 }
 
 
 LONG APIENTRY
 KeyboardApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
 {
-  PROPSHEETPAGE psp[3];
+  PROPSHEETPAGE psp[2];
   PROPSHEETHEADER psh;
   TCHAR Caption[256];
 
@@ -101,9 +99,8 @@ KeyboardApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
   psh.nStartPage = 0;
   psh.ppsp = psp;
 
-  InitPropSheetPage(&psp[0], IDD_PROPPAGE1, Page1Proc);
-  InitPropSheetPage(&psp[1], IDD_PROPPAGE2, Page2Proc);
-  InitPropSheetPage(&psp[2], IDD_PROPPAGE3, Page3Proc);
+  InitPropSheetPage(&psp[0], IDD_KEYBSPEED, KeybSpeedProc);
+  InitPropSheetPage(&psp[1], IDD_HARDWARE, KeybHardwareProc);
 
   return (LONG)(PropertySheet(&psh) != -1);
 }
index d930728..76fe853 100644 (file)
@@ -26,6 +26,8 @@
  *      05-01-2004  Created
  */
 #include <windows.h>
+#include <initguid.h>
+#include <devguid.h>
 #include <commctrl.h>
 #include <cpl.h>
 
index 3b85f7e..c674bd1 100644 (file)
@@ -1,6 +1,19 @@
 #ifndef __CPL_MAIN_H
 #define __CPL_MAIN_H
 
+typedef enum
+{
+    HWPD_STANDARDLIST = 0,
+    HWPD_LARGELIST,
+    HWPD_MAX = HWPD_LARGELIST
+} HWPAGE_DISPLAYMODE, *PHWPAGE_DISPLAYMODE;
+
+HWND WINAPI
+DeviceCreateHardwarePageEx(HWND hWndParent,
+                           LPGUID lpGuids,
+                           UINT uNumberOfGuids,
+                           HWPAGE_DISPLAYMODE DisplayMode);
+
 //typedef LONG (CALLBACK *APPLET_PROC)(VOID);
 
 typedef struct _APPLET
index 8be1cec..547c07c 100644 (file)
@@ -10,6 +10,7 @@
        <library>kernel32</library>
        <library>user32</library>
        <library>comctl32</library>
+       <library>devmgr</library>
        <file>keyboard.c</file>
        <file>main.c</file>
        <file>mouse.c</file>
index 5520cbe..bda0774 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include <windows.h>
+#include <devguid.h>
 #include <commctrl.h>
 #include <cpl.h>
 
@@ -85,10 +86,38 @@ Page3Proc(
 }
 
 
+/* Property page dialog callback */
+static INT_PTR CALLBACK
+MouseHardwareProc(IN HWND hwndDlg,
+                 IN UINT uMsg,
+                 IN WPARAM wParam,
+                 IN LPARAM lParam)
+{
+    switch(uMsg)
+    {
+        case WM_INITDIALOG:
+        {
+            GUID Guids[] = {
+                GUID_DEVCLASS_MOUSE
+            };
+
+            /* create the hardware page */
+            DeviceCreateHardwarePageEx(hwndDlg,
+                                       Guids,
+                                       sizeof(Guids) / sizeof(Guids[0]),
+                                       HWPD_STANDARDLIST);
+            break;
+        }
+    }
+
+    return FALSE;
+}
+
+
 LONG APIENTRY
 MouseApplet(HWND hwnd, UINT uMsg, LONG lParam1, LONG lParam2)
 {
-  PROPSHEETPAGE psp[3];
+  PROPSHEETPAGE psp[4];
   PROPSHEETHEADER psh;
   TCHAR Caption[256];
 
@@ -108,6 +137,7 @@ MouseApplet(HWND hwnd, UINT uMsg, LONG lParam1, LONG lParam2)
   InitPropSheetPage(&psp[0], IDD_PROPPAGE1, Page1Proc);
   InitPropSheetPage(&psp[1], IDD_PROPPAGE2, Page2Proc);
   InitPropSheetPage(&psp[2], IDD_PROPPAGE3, Page3Proc);
+  InitPropSheetPage(&psp[3], IDD_HARDWARE, MouseHardwareProc);
 
   return (LONG)(PropertySheet(&psh) != -1);
 }
index dee143b..d14372f 100644 (file)
@@ -8,6 +8,8 @@
 #define IDD_PROPPAGE1  100
 #define IDD_PROPPAGE2  101
 #define IDD_PROPPAGE3  102
+#define IDD_KEYBSPEED  103
+#define IDD_HARDWARE   104
 
 #define IDS_CPLNAME_1  1000
 #define IDS_CPLDESCRIPTION_1   1001