ReactOS 0.4.15-dev-8339-g4028de8
input.c File Reference
#include "input.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 (HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
static VOID InitPropSheetPage (PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc)
 
static BOOL AskForReboot (HWND hwndDlg)
 
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
 
BOOL g_bRebootNeeded = FALSE
 
static APPLET Applets [NUM_APPLETS]
 

Macro Definition Documentation

◆ NUM_APPLETS

#define NUM_APPLETS   (1)

Definition at line 13 of file input.c.

Function Documentation

◆ AskForReboot()

static BOOL AskForReboot ( HWND  hwndDlg)
static

Definition at line 39 of file input.c.

40{
41 WCHAR szText[128], szCaption[64];
42 LoadStringW(hApplet, IDS_REBOOT_NOW, szText, _countof(szText));
43 LoadStringW(hApplet, IDS_LANGUAGE, szCaption, _countof(szCaption));
44 return (MessageBoxW(hwndDlg, szText, szCaption, MB_ICONINFORMATION | MB_YESNO) == IDYES);
45}
HINSTANCE hApplet
Definition: input.c:17
#define IDS_LANGUAGE
Definition: resource.h:52
#define IDS_REBOOT_NOW
Definition: resource.h:62
#define _countof(array)
Definition: sndvol32.h:70
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MB_YESNO
Definition: winuser.h:817
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONINFORMATION
Definition: winuser.h:802
#define IDYES
Definition: winuser.h:835
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by PropSheetProc().

◆ CPlApplet()

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

Definition at line 113 of file input.c.

114{
115 CPLINFO *CPlInfo;
116 UINT i = (UINT)lParam1;
117
118 switch (uMsg)
119 {
120 case CPL_INIT:
121 return TRUE;
122
123 case CPL_GETCOUNT:
124 return NUM_APPLETS;
125
126 case CPL_INQUIRE:
127 if (i < NUM_APPLETS)
128 {
129 CPlInfo = (CPLINFO*)lParam2;
130 CPlInfo->lData = 0;
131 CPlInfo->idIcon = Applets[i].idIcon;
132 CPlInfo->idName = Applets[i].idName;
133 CPlInfo->idInfo = Applets[i].idDescription;
134 }
135 else
136 {
137 return TRUE;
138 }
139 break;
140
141 case CPL_DBLCLK:
142 if (i < NUM_APPLETS)
143 Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
144 else
145 return TRUE;
146 break;
147 }
148
149 return FALSE;
150}
#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 TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NUM_APPLETS
Definition: input.c:13
static APPLET Applets[NUM_APPLETS]
Definition: input.c:21
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
unsigned int UINT
Definition: ndis.h:50
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: 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

◆ DllMain()

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

Definition at line 154 of file input.c.

155{
157
158 switch (dwReason)
159 {
162 hApplet = hinstDLL;
163 break;
164 }
165
166 return TRUE;
167}
DWORD dwReason
Definition: misc.cpp:154
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_THREAD_ATTACH
Definition: compat.h:132
static IN DWORD IN LPVOID lpvReserved
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

◆ InitPropSheetPage()

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

Definition at line 28 of file input.c.

29{
30 ZeroMemory(page, sizeof(*page));
31
32 page->dwSize = sizeof(*page);
33 page->dwFlags = PSP_DEFAULT;
34 page->hInstance = hApplet;
35 page->pszTemplate = MAKEINTRESOURCEW(idDlg);
36 page->pfnDlgProc = DlgProc;
37}
WORD idDlg
Definition: desk.c:121
DLGPROC DlgProc
Definition: desk.c:122
#define PSP_DEFAULT
Definition: prsht.h:22
Definition: module.h:576
#define ZeroMemory
Definition: winbase.h:1712
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by SystemApplet().

◆ PropSheetProc()

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

Definition at line 48 of file input.c.

49{
50 switch (uMsg)
51 {
53 {
54 /* Set large icon correctly */
56 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
57 break;
58 }
59
60 case PSCB_BUTTONPRESSED:
61 {
62 switch (lParam)
63 {
64 case PSBTN_OK:
65 case PSBTN_APPLYNOW:
66 {
67 if (g_bRebootNeeded && AskForReboot(hwndDlg))
68 {
71 }
72 break;
73 }
74 }
75 break;
76 }
77 }
78 return 0;
79}
LPARAM lParam
Definition: combotst.c:139
#define IDI_CPLSYSTEM
Definition: resource.h:4
static BOOL AskForReboot(HWND hwndDlg)
Definition: input.c:39
BOOL g_bRebootNeeded
Definition: input.c:18
BOOL EnableProcessPrivileges(LPCWSTR lpPrivilegeName, BOOL bEnable)
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
#define PSBTN_APPLYNOW
Definition: prsht.h:150
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define PSBTN_OK
Definition: prsht.h:149
#define ICON_BIG
Definition: tnclass.cpp:51
LONG_PTR LPARAM
Definition: windef.h:208
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:384
#define EWX_REBOOT
Definition: winuser.h:638
#define EWX_FORCE
Definition: winuser.h:635
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2119
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by SystemApplet().

◆ SystemApplet()

static LONG CALLBACK SystemApplet ( HWND  hwnd,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)
static

Definition at line 83 of file input.c.

84{
87
88 ZeroMemory(&header, sizeof(header));
89
90 header.dwSize = sizeof(header);
92 header.hwndParent = hwnd;
93 header.hInstance = hApplet;
96 header.nPages = ARRAYSIZE(page);
97 header.nStartPage = 0;
98 header.ppsp = page;
99 header.pfnCallback = PropSheetProc;
100
101 /* Settings */
103
104 /* Advanced Settings */
106
107 return (LONG)(PropertySheetW(&header) != -1);
108}
INT_PTR CALLBACK AdvancedSettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define IDS_CPLSYSTEMNAME
Definition: resource.h:23
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: input.c:48
static VOID InitPropSheetPage(PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc)
Definition: input.c:28
#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:2913
long LONG
Definition: pedump.c:60
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Variable Documentation

◆ Applets

APPLET Applets[NUM_APPLETS]
static
Initial value:
=
{
}
#define IDS_CPLSYSTEMDESCRIPTION
Definition: resource.h:24
static LONG CALLBACK SystemApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: input.c:83

Definition at line 21 of file input.c.

Referenced by CPlApplet().

◆ g_bRebootNeeded

BOOL g_bRebootNeeded = FALSE

◆ hApplet

HINSTANCE hApplet = NULL

Definition at line 17 of file input.c.

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