2004-10-30 12:36:14 +00:00
|
|
|
/*
|
|
|
|
* ReactOS
|
|
|
|
* Copyright (C) 2004 ReactOS Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
2005-01-06 13:58:04 +00:00
|
|
|
/* $Id$
|
2004-10-30 12:36:14 +00:00
|
|
|
*
|
|
|
|
* PROJECT: ReactOS Main Control Panel
|
|
|
|
* FILE: lib/cpl/main/keyboard.c
|
|
|
|
* PURPOSE: Keyboard Control Panel
|
|
|
|
* PROGRAMMER: Eric Kohl
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <windows.h>
|
2005-11-25 17:02:18 +00:00
|
|
|
#include <devguid.h>
|
2004-10-30 12:36:14 +00:00
|
|
|
#include <commctrl.h>
|
|
|
|
#include <prsht.h>
|
|
|
|
#include <cpl.h>
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* Property page dialog callback */
|
|
|
|
static INT_PTR CALLBACK
|
2005-11-25 17:02:18 +00:00
|
|
|
KeybSpeedProc(IN HWND hwndDlg,
|
|
|
|
IN UINT uMsg,
|
|
|
|
IN WPARAM wParam,
|
|
|
|
IN LPARAM lParam)
|
2004-10-30 12:36:14 +00:00
|
|
|
{
|
2005-11-25 17:02:18 +00:00
|
|
|
switch(uMsg)
|
|
|
|
{
|
|
|
|
case WM_INITDIALOG:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
2004-10-30 12:36:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Property page dialog callback */
|
|
|
|
static INT_PTR CALLBACK
|
2005-11-25 17:02:18 +00:00
|
|
|
KeybHardwareProc(IN HWND hwndDlg,
|
|
|
|
IN UINT uMsg,
|
|
|
|
IN WPARAM wParam,
|
|
|
|
IN LPARAM lParam)
|
2004-10-30 12:36:14 +00:00
|
|
|
{
|
2006-05-03 11:18:07 +00:00
|
|
|
GUID Guids[1];
|
|
|
|
Guids[0] = GUID_DEVCLASS_KEYBOARD;
|
|
|
|
|
2005-11-25 17:02:18 +00:00
|
|
|
switch(uMsg)
|
|
|
|
{
|
|
|
|
case WM_INITDIALOG:
|
|
|
|
{
|
2006-05-03 11:18:07 +00:00
|
|
|
|
2004-10-30 12:36:14 +00:00
|
|
|
|
2005-11-25 17:02:18 +00:00
|
|
|
/* create the hardware page */
|
|
|
|
DeviceCreateHardwarePageEx(hwndDlg,
|
|
|
|
Guids,
|
|
|
|
sizeof(Guids) / sizeof(Guids[0]),
|
|
|
|
HWPD_STANDARDLIST);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2004-10-30 12:36:14 +00:00
|
|
|
|
2005-11-25 17:02:18 +00:00
|
|
|
return FALSE;
|
2004-10-30 12:36:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LONG APIENTRY
|
|
|
|
KeyboardApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
|
|
|
|
{
|
2005-11-25 17:02:18 +00:00
|
|
|
PROPSHEETPAGE psp[2];
|
2004-10-30 12:36:14 +00:00
|
|
|
PROPSHEETHEADER psh;
|
|
|
|
TCHAR Caption[256];
|
|
|
|
|
|
|
|
LoadString(hApplet, IDS_CPLNAME_2, Caption, sizeof(Caption) / sizeof(TCHAR));
|
|
|
|
|
|
|
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
|
|
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
|
|
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
|
|
|
psh.hwndParent = NULL;
|
|
|
|
psh.hInstance = hApplet;
|
2005-11-25 22:27:50 +00:00
|
|
|
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_2));
|
2004-10-30 12:36:14 +00:00
|
|
|
psh.pszCaption = Caption;
|
|
|
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
|
|
|
psh.nStartPage = 0;
|
|
|
|
psh.ppsp = psp;
|
|
|
|
|
2005-11-25 17:02:18 +00:00
|
|
|
InitPropSheetPage(&psp[0], IDD_KEYBSPEED, KeybSpeedProc);
|
|
|
|
InitPropSheetPage(&psp[1], IDD_HARDWARE, KeybHardwareProc);
|
2004-10-30 12:36:14 +00:00
|
|
|
|
|
|
|
return (LONG)(PropertySheet(&psh) != -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|