ReactOS 0.4.16-dev-197-g92996da
advanced_settings_page.c File Reference
#include "input.h"
Include dependency graph for advanced_settings_page.c:

Go to the source code of this file.

Functions

BOOL LoadAdvancedSettings (HWND hwndDlg)
 
BOOL SaveAdvancedSettings (HWND hwndDlg)
 
static INT_PTR OnNotifyAdvancedSettingsPage (HWND hwndDlg, LPARAM lParam)
 
INT_PTR CALLBACK AdvancedSettingsPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

BOOL g_bTextServiceIsOff = FALSE
 

Function Documentation

◆ AdvancedSettingsPageProc()

INT_PTR CALLBACK AdvancedSettingsPageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 81 of file advanced_settings_page.c.

82{
83 switch (uMsg)
84 {
85 case WM_INITDIALOG:
86 LoadAdvancedSettings(hwndDlg);
87 return TRUE;
88
89 case WM_NOTIFY:
90 return OnNotifyAdvancedSettingsPage(hwndDlg, lParam);
91
92 case WM_COMMAND:
93 {
94 switch (LOWORD(wParam))
95 {
97 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
98 break;
99 }
100 break;
101 }
102 }
103
104 return 0;
105}
BOOL LoadAdvancedSettings(HWND hwndDlg)
static INT_PTR OnNotifyAdvancedSettingsPage(HWND hwndDlg, LPARAM lParam)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define IDC_TURNOFFTEXTSVCS_CB
Definition: resource.h:61
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define WM_NOTIFY
Definition: richedit.h:61
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_INITDIALOG
Definition: winuser.h:1742
HWND WINAPI GetParent(_In_ HWND)

Referenced by SystemApplet().

◆ LoadAdvancedSettings()

BOOL LoadAdvancedSettings ( HWND  hwndDlg)

Definition at line 13 of file advanced_settings_page.c.

14{
15 HKEY hKey;
17 DWORD dwType;
18 DWORD dwValue;
19 DWORD cbValue = sizeof(dwValue);
20
21 error = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Microsoft\\CTF", 0, KEY_READ, &hKey);
22 if (error != ERROR_SUCCESS)
23 return FALSE;
24
26 L"Disable Thread Input Manager",
27 NULL,
28 &dwType,
29 (LPBYTE)&dwValue,
30 &cbValue);
31 if ((error != ERROR_SUCCESS) || (dwType != REG_DWORD) || (cbValue != sizeof(dwValue)))
32 dwValue = FALSE; /* Default */
33
35
37 g_bTextServiceIsOff = !!dwValue;
38 return TRUE;
39}
BOOL g_bTextServiceIsOff
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
#define L(x)
Definition: ntvdm.h:50
#define REG_DWORD
Definition: sdbapi.c:596
unsigned char * LPBYTE
Definition: typedefs.h:53
LONG_PTR LRESULT
Definition: windef.h:209
#define HKEY_CURRENT_USER
Definition: winreg.h:11
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define BST_UNCHECKED
Definition: winuser.h:199
#define BST_CHECKED
Definition: winuser.h:197

Referenced by AdvancedSettingsPageProc().

◆ OnNotifyAdvancedSettingsPage()

static INT_PTR OnNotifyAdvancedSettingsPage ( HWND  hwndDlg,
LPARAM  lParam 
)
static

Definition at line 59 of file advanced_settings_page.c.

60{
62
63 switch (header->code)
64 {
65 case PSN_APPLY:
66 {
70
71 /* Write advanced settings */
72 SaveAdvancedSettings(hwndDlg);
73 break;
74 }
75 }
76
77 return 0;
78}
BOOL SaveAdvancedSettings(HWND hwndDlg)
BOOL g_bRebootNeeded
Definition: input.c:18
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PSN_APPLY
Definition: prsht.h:117
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
struct tagNMHDR * LPNMHDR

Referenced by AdvancedSettingsPageProc().

◆ SaveAdvancedSettings()

BOOL SaveAdvancedSettings ( HWND  hwndDlg)

Definition at line 41 of file advanced_settings_page.c.

42{
43 HKEY hKey;
45 const DWORD dwValue = g_bTextServiceIsOff;
46 const DWORD cbValue = sizeof(dwValue);
47
48 error = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Microsoft\\CTF", 0, KEY_WRITE, &hKey);
49 if (error != ERROR_SUCCESS)
50 return FALSE;
51
52 error = RegSetValueExW(hKey, L"Disable Thread Input Manager", 0, REG_DWORD,
53 (const BYTE *)&dwValue, cbValue);
54
56 return (error == ERROR_SUCCESS);
57}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
#define KEY_WRITE
Definition: nt_native.h:1031
unsigned char BYTE
Definition: xxhash.c:193

Referenced by OnNotifyAdvancedSettingsPage().

Variable Documentation

◆ g_bTextServiceIsOff

BOOL g_bTextServiceIsOff = FALSE