reverting : revison 22930 to 22932, 22938 to 22940, 22943, 22945, 22950, 22953 to...
[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 switch(uMsg)
45 {
46 case WM_INITDIALOG:
47 break;
48 }
49
50 return FALSE;
51 }
52
53
54 /* Property page dialog callback */
55 static INT_PTR CALLBACK
56 KeybHardwareProc(IN HWND hwndDlg,
57 IN UINT uMsg,
58 IN WPARAM wParam,
59 IN LPARAM lParam)
60 {
61 GUID Guids[1];
62 Guids[0] = GUID_DEVCLASS_KEYBOARD;
63
64 switch(uMsg)
65 {
66 case WM_INITDIALOG:
67 {
68
69
70 /* create the hardware page */
71 DeviceCreateHardwarePageEx(hwndDlg,
72 Guids,
73 sizeof(Guids) / sizeof(Guids[0]),
74 HWPD_STANDARDLIST);
75 break;
76 }
77 }
78
79 return FALSE;
80 }
81
82
83 LONG APIENTRY
84 KeyboardApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
85 {
86 PROPSHEETPAGE psp[2];
87 PROPSHEETHEADER psh;
88 TCHAR Caption[256];
89
90 LoadString(hApplet, IDS_CPLNAME_2, Caption, sizeof(Caption) / sizeof(TCHAR));
91
92 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
93 psh.dwSize = sizeof(PROPSHEETHEADER);
94 psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
95 psh.hwndParent = NULL;
96 psh.hInstance = hApplet;
97 psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_2));
98 psh.pszCaption = Caption;
99 psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
100 psh.nStartPage = 0;
101 psh.ppsp = psp;
102
103 InitPropSheetPage(&psp[0], IDD_KEYBSPEED, KeybSpeedProc);
104 InitPropSheetPage(&psp[1], IDD_HARDWARE, KeybHardwareProc);
105
106 return (LONG)(PropertySheet(&psh) != -1);
107 }
108
109 /* EOF */