ReactOS  0.4.15-dev-1201-gb2cf5a4
input.c
Go to the documentation of this file.
1 /*
2  * PROJECT: input.dll
3  * FILE: dll/cpl/input/input.c
4  * PURPOSE: input.dll
5  * PROGRAMMER: Dmitry Chapyshev (lentind@yandex.ru)
6  * Colin Finck
7  * UPDATE HISTORY:
8  * 06-09-2007 Created
9  */
10 
11 #include "input.h"
12 
13 #define NUM_APPLETS (1)
14 
15 static LONG CALLBACK SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
16 
18 
19 /* Applets */
21 {
23 };
24 
25 
26 static VOID
28 {
29  ZeroMemory(page, sizeof(*page));
30 
31  page->dwSize = sizeof(*page);
32  page->dwFlags = PSP_DEFAULT;
33  page->hInstance = hApplet;
34  page->pszTemplate = MAKEINTRESOURCEW(idDlg);
35  page->pfnDlgProc = DlgProc;
36 }
37 
38 static int CALLBACK
40 {
41  // NOTE: This callback is needed to set large icon correctly.
42  HICON hIcon;
43  switch (uMsg)
44  {
45  case PSCB_INITIALIZED:
46  {
48  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
49  break;
50  }
51  }
52  return 0;
53 }
54 
55 /* First Applet */
56 static LONG CALLBACK
57 SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
58 {
61  WCHAR szCaption[MAX_STR_LEN];
62 
63  LoadStringW(hApplet, IDS_CPLSYSTEMNAME, szCaption, ARRAYSIZE(szCaption));
64 
65  ZeroMemory(&header, sizeof(header));
66 
67  header.dwSize = sizeof(header);
69  header.hwndParent = hwnd;
70  header.hInstance = hApplet;
72  header.pszCaption = szCaption;
73  header.nPages = ARRAYSIZE(page);
74  header.nStartPage = 0;
75  header.ppsp = page;
76  header.pfnCallback = PropSheetProc;
77 
78  /* Settings */
80 
81  /* Advanced Settings */
83 
84  return (LONG)(PropertySheetW(&header) != -1);
85 }
86 
87 
88 /* Control Panel Callback */
90 CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
91 {
92  CPLINFO *CPlInfo;
93  DWORD i;
94 
95  i = (DWORD)lParam1;
96 
97  switch (uMsg)
98  {
99  case CPL_INIT:
100  return TRUE;
101 
102  case CPL_GETCOUNT:
103  return NUM_APPLETS;
104 
105  case CPL_INQUIRE:
106  CPlInfo = (CPLINFO*)lParam2;
107  CPlInfo->lData = 0;
108  CPlInfo->idIcon = Applets[i].idIcon;
109  CPlInfo->idName = Applets[i].idName;
110  CPlInfo->idInfo = Applets[i].idDescription;
111  break;
112 
113  case CPL_DBLCLK:
114  Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
115  break;
116  }
117 
118  return FALSE;
119 }
120 
121 
122 BOOL WINAPI
124 {
126 
127  switch (dwReason)
128  {
129  case DLL_PROCESS_ATTACH:
130  case DLL_THREAD_ATTACH:
131  hApplet = hinstDLL;
132  break;
133  }
134 
135  return TRUE;
136 }
137 
138 /* EOF */
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD idDlg
Definition: desk.c:110
static HICON
Definition: imagelist.c:84
Definition: cpl.h:24
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define DLL_THREAD_ATTACH
Definition: compat.h:132
#define IDI_CPLSYSTEM
Definition: resource.h:4
INT_PTR CALLBACK AdvancedSettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
int idName
Definition: hotplug.h:36
int idIcon
Definition: hotplug.h:35
#define CALLBACK
Definition: compat.h:35
int idInfo
Definition: cpl.h:27
HINSTANCE hApplet
Definition: input.c:17
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define ZeroMemory
Definition: winbase.h:1648
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define PSH_USECALLBACK
Definition: prsht.h:48
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static IN DWORD IN LPVOID lpvReserved
int idIcon
Definition: cpl.h:25
int idDescription
Definition: hotplug.h:37
#define CPL_DBLCLK
Definition: cpl.h:16
DWORD dwReason
Definition: misc.cpp:154
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define PSH_USEICONID
Definition: prsht.h:42
#define FALSE
Definition: types.h:117
#define IDI_KEY_SHORT_ICO
Definition: resource.h:7
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
LONG CALLBACK CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: input.c:90
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
Definition: module.h:566
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2905
#define IDS_CPLSYSTEMNAME
Definition: resource.h:23
#define PSP_DEFAULT
Definition: prsht.h:22
#define NUM_APPLETS
Definition: input.c:13
__wchar_t WCHAR
Definition: xmlstorage.h:180
APPLET_PROC AppletProc
Definition: hotplug.h:38
#define WINAPI
Definition: msvc.h:6
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
static APPLET Applets[NUM_APPLETS]
Definition: input.c:20
#define CPL_INIT
Definition: cpl.h:12
#define CPL_INQUIRE
Definition: cpl.h:14
static POINTER_INPUT_TYPE *static DWORD
Definition: input.c:84
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2871
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
Definition: input.c:123
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDS_CPLSYSTEMDESCRIPTION
Definition: resource.h:24
unsigned int UINT
Definition: ndis.h:50
static VOID InitPropSheetPage(PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc)
Definition: input.c:27
#define MAX_STR_LEN
Definition: defines.h:35
static LONG CALLBACK SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: input.c:57
#define IDD_PROPPAGEADVANCEDSETTINGS
Definition: resource.h:13
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: input.c:39
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
LPARAM lParam
Definition: combotst.c:139
DLGPROC DlgProc
Definition: desk.c:111
#define CPL_GETCOUNT
Definition: cpl.h:13
struct CFHEADER header
Definition: fdi.c:101
#define ICON_BIG
Definition: tnclass.cpp:51
Definition: hotplug.h:33
#define IDD_PROPPAGESETTINGS
Definition: resource.h:12