ReactOS 0.4.15-dev-7958-gcd0bb1a
advanced_settings_page.c
Go to the documentation of this file.
1/*
2* PROJECT: input.dll
3* FILE: dll/cpl/input/advanced_settings_page.c
4* PURPOSE: input.dll
5* PROGRAMMER: Dmitry Chapyshev (dmitry@reactos.org)
6* Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7*/
8
9#include "input.h"
10
12
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}
40
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}
58
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}
79
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 g_bTextServiceIsOff
BOOL LoadAdvancedSettings(HWND hwndDlg)
BOOL SaveAdvancedSettings(HWND hwndDlg)
INT_PTR CALLBACK AdvancedSettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static INT_PTR OnNotifyAdvancedSettingsPage(HWND hwndDlg, LPARAM lParam)
#define RegCloseKey(hKey)
Definition: registry.h:49
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL g_bRebootNeeded
Definition: input.c:18
#define IDC_TURNOFFTEXTSVCS_CB
Definition: resource.h:61
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
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
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
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define error(str)
Definition: mkdosfs.c:1605
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_WRITE
Definition: nt_native.h:1031
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define WM_NOTIFY
Definition: richedit.h:61
#define REG_DWORD
Definition: sdbapi.c:596
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * LPBYTE
Definition: typedefs.h:53
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#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 WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define BST_CHECKED
Definition: winuser.h:197
unsigned char BYTE
Definition: xxhash.c:193