3 * Copyright (C) 2007 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 * FILE: dll/win32/input/advanced.c
24 * PROGRAMMER: Dmitry Chapyshev (lentind@yandex.ru)
33 InitControls(HWND hWnd
)
36 DWORD dwValue
, dwType
, dwSize
;
38 if (SendDlgItemMessage(hWnd
, IDC_TURNOFF_ADV_TXTSERV_CHECKBOX
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
40 EnableWindow(GetDlgItem(hWnd
, IDC_SUPPORT_ADV_SERV_CHECKBOX
),FALSE
);
41 EnableWindow(GetDlgItem(hWnd
, IDC_SUPPORT_ADV_SERV_TEXT
),FALSE
);
43 if (RegOpenKeyEx(HKEY_CURRENT_USER
, L
"Software\\Microsoft\\CTF", 0, KEY_QUERY_VALUE
, &hKey
) == ERROR_SUCCESS
)
46 dwSize
= sizeof(DWORD
);
47 if (RegQueryValueEx(hKey
,
48 L
"Disable Thread Input Manager",
52 &dwSize
) == ERROR_SUCCESS
)
55 SendDlgItemMessage(hWnd
, IDC_TURNOFF_ADV_TXTSERV_CHECKBOX
, BM_SETCHECK
, 0, 0);
57 SendDlgItemMessage(hWnd
, IDC_TURNOFF_ADV_TXTSERV_CHECKBOX
, BM_SETCHECK
, 1, 1);
64 SaveSettings(HWND hWnd
)
67 DWORD dwValue
, dwType
, dwSize
;
69 if (RegOpenKey(HKEY_CURRENT_USER
, L
"Software\\Microsoft\\CTF",&hKey
) == ERROR_SUCCESS
)
72 dwSize
= sizeof(DWORD
);
73 if (SendDlgItemMessage(hWnd
, IDC_TURNOFF_ADV_TXTSERV_CHECKBOX
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
78 L
"Disable Thread Input Manager",
87 /* Property page dialog callback */
89 AdvancedPageProc(HWND hwndDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
91 UNREFERENCED_PARAMETER(lParam
);
92 UNREFERENCED_PARAMETER(wParam
);
93 UNREFERENCED_PARAMETER(hwndDlg
);
99 InitControls(hwndDlg
);
104 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
105 if (lpnm
->code
== (UINT
)PSN_APPLY
)
107 SaveSettings(hwndDlg
);
112 switch (LOWORD(wParam
))
114 case IDC_SUPPORT_ADV_SERV_CHECKBOX
:
115 case IDC_TURNOFF_ADV_TXTSERV_CHECKBOX
:
117 if (SendDlgItemMessage(hwndDlg
, IDC_TURNOFF_ADV_TXTSERV_CHECKBOX
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
119 EnableWindow(GetDlgItem(hwndDlg
, IDC_SUPPORT_ADV_SERV_CHECKBOX
),FALSE
);
120 EnableWindow(GetDlgItem(hwndDlg
, IDC_SUPPORT_ADV_SERV_TEXT
),FALSE
);
124 EnableWindow(GetDlgItem(hwndDlg
, IDC_SUPPORT_ADV_SERV_CHECKBOX
),TRUE
);
125 EnableWindow(GetDlgItem(hwndDlg
, IDC_SUPPORT_ADV_SERV_TEXT
),TRUE
);
127 PropSheet_Changed(GetParent(hwndDlg
), hwndDlg
);