Constantin Kaplinsky | 47ed8d3 | 2004-10-08 09:43:57 +0000 | [diff] [blame^] | 1 | /* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. |
| 2 | * |
| 3 | * This is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This software is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this software; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 16 | * USA. |
| 17 | */ |
| 18 | #ifndef WINVNCCONF_HOOKING |
| 19 | #define WINVNCCONF_HOOKING |
| 20 | |
| 21 | #include <rfb_win32/Registry.h> |
| 22 | #include <rfb_win32/Dialog.h> |
| 23 | #include <rfb_win32/SDisplay.h> |
| 24 | #include <rfb/ServerCore.h> |
| 25 | |
| 26 | namespace rfb { |
| 27 | |
| 28 | namespace win32 { |
| 29 | |
| 30 | class HookingPage : public PropSheetPage { |
| 31 | public: |
| 32 | HookingPage(const RegKey& rk) |
| 33 | : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_HOOKING)), regKey(rk) {} |
| 34 | void initDialog() { |
| 35 | setItemChecked(IDC_USEHOOKS, rfb::win32::SDisplay::use_hooks); |
| 36 | setItemChecked(IDC_POLLCONSOLES, rfb::win32::WMPoller::poll_console_windows); |
| 37 | setItemChecked(IDC_COMPAREFB, rfb::Server::compareFB); |
| 38 | } |
| 39 | bool onCommand(int id, int cmd) { |
| 40 | switch (id) { |
| 41 | case IDC_USEHOOKS: |
| 42 | case IDC_POLLCONSOLES: |
| 43 | case IDC_COMPAREFB: |
| 44 | setChanged((rfb::win32::SDisplay::use_hooks != isItemChecked(IDC_USEHOOKS)) || |
| 45 | (rfb::win32::WMPoller::poll_console_windows != isItemChecked(IDC_POLLCONSOLES)) || |
| 46 | (rfb::Server::compareFB != isItemChecked(IDC_COMPAREFB))); |
| 47 | break; |
| 48 | } |
| 49 | return false; |
| 50 | } |
| 51 | bool onOk() { |
| 52 | regKey.setBool(_T("UseHooks"), isItemChecked(IDC_USEHOOKS)); |
| 53 | regKey.setBool(_T("PollConsoleWindows"), isItemChecked(IDC_POLLCONSOLES)); |
| 54 | regKey.setBool(_T("CompareFB"), isItemChecked(IDC_COMPAREFB)); |
| 55 | return true; |
| 56 | } |
| 57 | protected: |
| 58 | RegKey regKey; |
| 59 | }; |
| 60 | |
| 61 | }; |
| 62 | |
| 63 | }; |
| 64 | |
| 65 | #endif |