- Create KD branch. All debugging support is removed in this branch (no symbols,...
[reactos.git] / reactos / dll / cpl / main / keyboard.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 Main Control Panel
22 * FILE: lib/cpl/main/keyboard.c
23 * PURPOSE: Keyboard Control Panel
24 * PROGRAMMER: Eric Kohl
25 */
26
27 #include <windows.h>
28 #include <devguid.h>
29 #include <commctrl.h>
30 #include <prsht.h>
31 #include <cpl.h>
32
33 #include "main.h"
34 #include "resource.h"
35
36
37 /* Property page dialog callback */
38 static INT_PTR CALLBACK
39 KeybSpeedProc(IN HWND hwndDlg,
40 IN UINT uMsg,
41 IN WPARAM wParam,
42 IN LPARAM lParam)
43 {
44 UNREFERENCED_PARAMETER(lParam);
45 UNREFERENCED_PARAMETER(wParam);
46 UNREFERENCED_PARAMETER(hwndDlg);
47 switch(uMsg)
48 {
49 case WM_INITDIALOG:
50 break;
51 }
52
53 return FALSE;
54 }
55
56
57 /* Property page dialog callback */
58 static INT_PTR CALLBACK
59 KeybHardwareProc(IN HWND hwndDlg,
60 IN UINT uMsg,
61 IN WPARAM wParam,
62 IN LPARAM lParam)
63 {
64 GUID Guids[1];
65 Guids[0] = GUID_DEVCLASS_KEYBOARD;
66
67 UNREFERENCED_PARAMETER(lParam);
68 UNREFERENCED_PARAMETER(wParam);
69
70 switch(uMsg)
71 {
72 case WM_INITDIALOG:
73 {
74
75
76 /* create the hardware page */
77 DeviceCreateHardwarePageEx(hwndDlg,
78 Guids,
79 sizeof(Guids) / sizeof(Guids[0]),
80 HWPD_STANDARDLIST);
81 break;
82 }
83 }
84
85 return FALSE;
86 }
87
88
89 LONG APIENTRY
90 KeyboardApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
91 {
92 PROPSHEETPAGE psp[2];
93 PROPSHEETHEADER psh;
94 TCHAR Caption[256];
95
96 UNREFERENCED_PARAMETER(lParam);
97 UNREFERENCED_PARAMETER(wParam);
98 UNREFERENCED_PARAMETER(uMsg);
99 UNREFERENCED_PARAMETER(hwnd);
100
101 LoadString(hApplet, IDS_CPLNAME_2, Caption, sizeof(Caption) / sizeof(TCHAR));
102
103 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
104 psh.dwSize = sizeof(PROPSHEETHEADER);
105 psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
106 psh.hwndParent = NULL;
107 psh.hInstance = hApplet;
108 psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_2));
109 psh.pszCaption = Caption;
110 psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
111 psh.nStartPage = 0;
112 psh.ppsp = psp;
113
114 InitPropSheetPage(&psp[0], IDD_KEYBSPEED, KeybSpeedProc);
115 InitPropSheetPage(&psp[1], IDD_HARDWARE, KeybHardwareProc);
116
117 return (LONG)(PropertySheet(&psh) != -1);
118 }
119
120 /* EOF */