ReactOS 0.4.15-dev-6049-ge54b32b
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
15static LONG CALLBACK SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
16
18
19/* Applets */
21{
23};
24
25
26static 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
38static int CALLBACK
40{
41 // NOTE: This callback is needed to set large icon correctly.
43 switch (uMsg)
44 {
46 {
48 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
49 break;
50 }
51 }
52 return 0;
53}
54
55/* First Applet */
56static LONG CALLBACK
57SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
58{
61
62 ZeroMemory(&header, sizeof(header));
63
64 header.dwSize = sizeof(header);
66 header.hwndParent = hwnd;
67 header.hInstance = hApplet;
70 header.nPages = ARRAYSIZE(page);
71 header.nStartPage = 0;
72 header.ppsp = page;
73 header.pfnCallback = PropSheetProc;
74
75 /* Settings */
77
78 /* Advanced Settings */
80
81 return (LONG)(PropertySheetW(&header) != -1);
82}
83
84
85/* Control Panel Callback */
87CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
88{
89 CPLINFO *CPlInfo;
90 UINT i = (UINT)lParam1;
91
92 switch (uMsg)
93 {
94 case CPL_INIT:
95 return TRUE;
96
97 case CPL_GETCOUNT:
98 return NUM_APPLETS;
99
100 case CPL_INQUIRE:
101 if (i < NUM_APPLETS)
102 {
103 CPlInfo = (CPLINFO*)lParam2;
104 CPlInfo->lData = 0;
105 CPlInfo->idIcon = Applets[i].idIcon;
106 CPlInfo->idName = Applets[i].idName;
107 CPlInfo->idInfo = Applets[i].idDescription;
108 }
109 else
110 {
111 return TRUE;
112 }
113 break;
114
115 case CPL_DBLCLK:
116 if (i < NUM_APPLETS)
117 Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
118 else
119 return TRUE;
120 break;
121 }
122
123 return FALSE;
124}
125
126
129{
131
132 switch (dwReason)
133 {
136 hApplet = hinstDLL;
137 break;
138 }
139
140 return TRUE;
141}
142
143/* EOF */
INT_PTR CALLBACK AdvancedSettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
DWORD dwReason
Definition: misc.cpp:154
LPARAM lParam
Definition: combotst.c:139
#define CPL_INQUIRE
Definition: cpl.h:14
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_INIT
Definition: cpl.h:12
#define CPL_GETCOUNT
Definition: cpl.h:13
#define DLGPROC
Definition: maze.c:62
WORD idDlg
Definition: desk.c:110
INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
DLGPROC DlgProc
Definition: desk.c:111
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_CPLSYSTEMNAME
Definition: resource.h:23
#define IDS_CPLSYSTEMDESCRIPTION
Definition: resource.h:24
#define IDI_CPLSYSTEM
Definition: resource.h:4
static LONG CALLBACK SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: input.c:57
#define NUM_APPLETS
Definition: input.c:13
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: input.c:39
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
Definition: input.c:128
static VOID InitPropSheetPage(PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc)
Definition: input.c:27
static APPLET Applets[NUM_APPLETS]
Definition: input.c:20
HINSTANCE hApplet
Definition: input.c:17
#define IDD_PROPPAGEADVANCEDSETTINGS
Definition: resource.h:14
#define IDD_PROPPAGESETTINGS
Definition: resource.h:13
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2905
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define CALLBACK
Definition: compat.h:35
#define DLL_THREAD_ATTACH
Definition: compat.h:132
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
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
static IN DWORD IN LPVOID lpvReserved
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
unsigned int UINT
Definition: ndis.h:50
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
long LONG
Definition: pedump.c:60
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSP_DEFAULT
Definition: prsht.h:22
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
#define PSCB_INITIALIZED
Definition: prsht.h:75
Definition: hotplug.h:34
int idDescription
Definition: hotplug.h:37
int idName
Definition: hotplug.h:36
int idIcon
Definition: hotplug.h:35
APPLET_PROC AppletProc
Definition: hotplug.h:38
Definition: module.h:576
Definition: cpl.h:24
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
#define ICON_BIG
Definition: tnclass.cpp:51
#define ZeroMemory
Definition: winbase.h:1670
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
#define WINAPI
Definition: msvc.h:6
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2044
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)