ReactOS  0.4.13-dev-259-g5ca9c9c
input.c File Reference
#include "input.h"
#include <cpl.h>
Include dependency graph for input.c:

Go to the source code of this file.

Macros

#define NUM_APPLETS   (1)
 

Functions

static LONG CALLBACK SystemApplet (VOID)
 
static VOID InitPropSheetPage (PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
LONG CALLBACK CPlApplet (HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
 

Variables

HINSTANCE hApplet = NULL
 
static HWND hCPLWindow
 
static APPLET Applets [NUM_APPLETS]
 

Macro Definition Documentation

◆ NUM_APPLETS

#define NUM_APPLETS   (1)

Definition at line 15 of file input.c.

Function Documentation

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hwndCPl,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 93 of file input.c.

94 {
95  CPLINFO *CPlInfo;
96  DWORD i;
97 
98  i = (DWORD)lParam1;
99 
100  switch (uMsg)
101  {
102  case CPL_INIT:
103  return TRUE;
104 
105  case CPL_GETCOUNT:
106  return NUM_APPLETS;
107 
108  case CPL_INQUIRE:
109  CPlInfo = (CPLINFO*)lParam2;
110  CPlInfo->lData = 0;
111  CPlInfo->idIcon = Applets[i].idIcon;
112  CPlInfo->idName = Applets[i].idName;
113  CPlInfo->idInfo = Applets[i].idDescription;
114  break;
115 
116  case CPL_DBLCLK:
117  hCPLWindow = hwndCPl;
118  Applets[i].AppletProc();
119  break;
120  }
121 
122  return FALSE;
123 }
static DWORD
Definition: input.c:87
#define TRUE
Definition: types.h:120
Definition: cpl.h:24
int idName
Definition: hotplug.h:27
int idIcon
Definition: hotplug.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
int idDescription
Definition: hotplug.h:28
#define CPL_DBLCLK
Definition: cpl.h:16
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 NUM_APPLETS
Definition: input.c:15
APPLET_PROC AppletProc
Definition: hotplug.h:29
static HWND hCPLWindow
Definition: input.c:20
unsigned long DWORD
Definition: ntddk_ex.h:95
static APPLET Applets[NUM_APPLETS]
Definition: input.c:23
#define CPL_INIT
Definition: cpl.h:12
#define CPL_INQUIRE
Definition: cpl.h:14
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
#define CPL_GETCOUNT
Definition: cpl.h:13

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpvReserved 
)

Definition at line 127 of file input.c.

128 {
130 
131  switch (dwReason)
132  {
133  case DLL_PROCESS_ATTACH:
134  case DLL_THREAD_ATTACH:
135  hApplet = hinstDLL;
136  break;
137  }
138 
139  return TRUE;
140 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define DLL_THREAD_ATTACH
Definition: compat.h:121
HINSTANCE hApplet
Definition: input.c:19
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
DWORD dwReason
Definition: misc.cpp:154

◆ InitPropSheetPage()

static VOID InitPropSheetPage ( PROPSHEETPAGEW page,
WORD  idDlg,
DLGPROC  DlgProc 
)
static

Definition at line 30 of file input.c.

31 {
32  ZeroMemory(page, sizeof(*page));
33 
34  page->dwSize = sizeof(*page);
35  page->dwFlags = PSP_DEFAULT;
36  page->hInstance = hApplet;
37  page->pszTemplate = MAKEINTRESOURCEW(idDlg);
38  page->pfnDlgProc = DlgProc;
39 }
WORD idDlg
Definition: desk.c:109
HINSTANCE hApplet
Definition: input.c:19
#define ZeroMemory
Definition: winbase.h:1635
Definition: module.h:566
#define PSP_DEFAULT
Definition: prsht.h:22
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
DLGPROC DlgProc
Definition: desk.c:110

Referenced by SystemApplet().

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 42 of file input.c.

43 {
44  // NOTE: This callback is needed to set large icon correctly.
45  HICON hIcon;
46  switch (uMsg)
47  {
48  case PSCB_INITIALIZED:
49  {
51  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
52  break;
53  }
54  }
55  return 0;
56 }
static HICON
Definition: imagelist.c:84
HINSTANCE hApplet
Definition: input.c:19
#define IDI_KEY_SHORT_ICO
Definition: resource.h:7
LONG_PTR LPARAM
Definition: windef.h:208
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by SystemApplet().

◆ SystemApplet()

static LONG CALLBACK SystemApplet ( VOID  )
static

Definition at line 60 of file input.c.

61 {
64  WCHAR szCaption[MAX_STR_LEN];
65 
66  LoadStringW(hApplet, IDS_CPLSYSTEMNAME, szCaption, ARRAYSIZE(szCaption));
67 
68  ZeroMemory(&header, sizeof(header));
69 
70  header.dwSize = sizeof(header);
72  header.hwndParent = hCPLWindow;
73  header.hInstance = hApplet;
75  header.pszCaption = szCaption;
76  header.nPages = ARRAYSIZE(page);
77  header.nStartPage = 0;
78  header.ppsp = page;
79  header.pfnCallback = PropSheetProc;
80 
81  /* Settings */
83 
84  /* Advanced Settings */
86 
87  return (LONG)(PropertySheetW(&header) != -1);
88 }
INT_PTR CALLBACK AdvancedSettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
HINSTANCE hApplet
Definition: input.c:19
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define ZeroMemory
Definition: winbase.h:1635
#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)
#define PSH_USEICONID
Definition: prsht.h:42
#define IDI_KEY_SHORT_ICO
Definition: resource.h:7
long LONG
Definition: pedump.c:60
Definition: module.h:566
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2896
#define IDS_CPLSYSTEMNAME
Definition: resource.h:23
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HWND hCPLWindow
Definition: input.c:20
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
static VOID InitPropSheetPage(PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc)
Definition: input.c:30
#define MAX_STR_LEN
Definition: defines.h:33
#define IDD_PROPPAGEADVANCEDSETTINGS
Definition: resource.h:13
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: input.c:42
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
struct CFHEADER header
Definition: fdi.c:109
#define IDD_PROPPAGESETTINGS
Definition: resource.h:12

Variable Documentation

◆ Applets

APPLET Applets[NUM_APPLETS]
static
Initial value:
=
{
}
#define IDI_CPLSYSTEM
Definition: resource.h:4
#define IDS_CPLSYSTEMNAME
Definition: resource.h:23
static LONG CALLBACK SystemApplet(VOID)
Definition: input.c:60
#define IDS_CPLSYSTEMDESCRIPTION
Definition: resource.h:24

Definition at line 23 of file input.c.

Referenced by CPlApplet().

◆ hApplet

HINSTANCE hApplet = NULL

Definition at line 19 of file input.c.

Referenced by DllMain(), InitPropSheetPage(), PropSheetProc(), and SystemApplet().

◆ hCPLWindow

HWND hCPLWindow
static

Definition at line 20 of file input.c.

Referenced by CPlApplet(), and SystemApplet().