diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2004-10-08 09:43:57 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2004-10-08 09:43:57 +0000 |
commit | 47ed8d321c32c6b741cff1f4ff686165c4f269f4 (patch) | |
tree | da413648adbff4ff10c8ee26124673f8e7cf238a /vncconfig | |
parent | 266bb36cd47555280fffd3aab1ed86683e26d748 (diff) | |
download | tigervnc-47ed8d321c32c6b741cff1f4ff686165c4f269f4.tar.gz tigervnc-47ed8d321c32c6b741cff1f4ff686165c4f269f4.zip |
Initial revision
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncconfig')
-rw-r--r-- | vncconfig/Authentication.h | 137 | ||||
-rw-r--r-- | vncconfig/Connections.h | 278 | ||||
-rw-r--r-- | vncconfig/Desktop.h | 93 | ||||
-rw-r--r-- | vncconfig/Hooking.h | 65 | ||||
-rw-r--r-- | vncconfig/Inputs.h | 84 | ||||
-rw-r--r-- | vncconfig/Legacy.cxx | 248 | ||||
-rw-r--r-- | vncconfig/Legacy.h | 86 | ||||
-rw-r--r-- | vncconfig/Sharing.h | 59 | ||||
-rw-r--r-- | vncconfig/resource.h | 86 | ||||
-rw-r--r-- | vncconfig/vncconfig.cxx | 193 | ||||
-rw-r--r-- | vncconfig/vncconfig.dsp | 188 | ||||
-rw-r--r-- | vncconfig/vncconfig.exe.manifest | 22 | ||||
-rw-r--r-- | vncconfig/vncconfig.ico | bin | 0 -> 1078 bytes | |||
-rw-r--r-- | vncconfig/vncconfig.rc | 479 |
14 files changed, 2018 insertions, 0 deletions
diff --git a/vncconfig/Authentication.h b/vncconfig/Authentication.h new file mode 100644 index 00000000..5923c2cb --- /dev/null +++ b/vncconfig/Authentication.h @@ -0,0 +1,137 @@ +/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ +#ifndef WINVNCCONF_AUTHENTICATION +#define WINVNCCONF_AUTHENTICATION + +#include <rfb_win32/Registry.h> +#include <rfb_win32/Dialog.h> +#include <rfb_win32/Win32Util.h> +#include <rfb/ServerCore.h> +#include <rfb/secTypes.h> +#include <rfb/vncAuth.h> + + +extern rfb::VncAuthPasswdConfigParameter vncAuthPasswd; + +namespace rfb { + + namespace win32 { + + class VncPasswdDialog : public Dialog { + public: + VncPasswdDialog(const RegKey& rk) : Dialog(GetModuleHandle(0)), regKey(rk), warnPasswdInsecure(false) {} + bool showDialog() { + return Dialog::showDialog(MAKEINTRESOURCE(IDD_AUTH_VNC_PASSWD)); + } + bool onOk() { + TCharArray password1 = getItemString(IDC_PASSWORD1); + TCharArray password2 = getItemString(IDC_PASSWORD2);; + if (_tcscmp(password1.buf, password2.buf) != 0) { + MsgBox(0, _T("The supplied passwords do not match"), + MB_ICONEXCLAMATION | MB_OK); + return false; + } + if (warnPasswdInsecure && + (MsgBox(0, _T("Please note that your VNC password cannot be stored securely on this system. ") + _T("Are you sure you wish to continue?"), + MB_YESNO | MB_ICONWARNING) == IDNO)) + return false; + char passwd[9]; + memset(passwd, 0, sizeof(passwd)); + strCopy(passwd, CStr(password1.buf), sizeof(passwd)); + vncAuthObfuscatePasswd(passwd); + regKey.setBinary(_T("Password"), passwd, 8); + return true; + } + void setWarnPasswdInsecure(bool warn) { + warnPasswdInsecure = warn; + } + protected: + const RegKey& regKey; + bool warnPasswdInsecure; + }; + + class AuthenticationPage : public PropSheetPage { + public: + AuthenticationPage(const RegKey& rk) + : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_AUTHENTICATION)), + passwd(rk), regKey(rk) {} + void initDialog() { + CharArray sec_types_str; + sec_types_str.buf = rfb::Server::sec_types.getData(); + std::list<int> sec_types = parseSecTypes(sec_types_str.buf); + + useNone = useVNC = false; + std::list<int>::iterator i; + for (i=sec_types.begin(); i!=sec_types.end(); i++) { + if ((*i) == secTypeNone) useNone = true; + else if ((*i) == secTypeVncAuth) useVNC = true; + } + + setItemChecked(IDC_AUTH_NONE, useNone); + setItemChecked(IDC_AUTH_VNC, useVNC); + setItemChecked(IDC_QUERY_CONNECT, rfb::Server::queryConnect); + } + bool onCommand(int id, int cmd) { + switch (id) { + case IDC_AUTH_VNC_PASSWD: + passwd.showDialog(); + return true; + case IDC_AUTH_NONE: + case IDC_AUTH_VNC: + case IDC_QUERY_CONNECT: + setChanged((rfb::Server::queryConnect != isItemChecked(IDC_QUERY_CONNECT)) || + (useNone != isItemChecked(IDC_AUTH_NONE)) || + (useVNC != isItemChecked(IDC_AUTH_VNC))); + return false; + }; + return false; + } + bool onOk() { + useVNC = isItemChecked(IDC_AUTH_VNC); + useNone = isItemChecked(IDC_AUTH_NONE); + if (useVNC) { + CharArray password = vncAuthPasswd.getVncAuthPasswd(); + if (!password.buf || strlen(password.buf) == 0) { + MsgBox(0, _T("The VNC authentication method is enabled, but no password is specified! ") + _T("The password dialog will now be shown."), MB_ICONEXCLAMATION | MB_OK); + passwd.showDialog(); + } + regKey.setString(_T("SecurityTypes"), _T("VncAuth")); + } else if (useNone) { + regKey.setString(_T("SecurityTypes"), _T("None")); + } + regKey.setString(_T("ReverseSecurityTypes"), _T("None")); + regKey.setBool(_T("QueryConnect"), isItemChecked(IDC_QUERY_CONNECT)); + return true; + } + void setWarnPasswdInsecure(bool warn) { + passwd.setWarnPasswdInsecure(warn); + } + protected: + RegKey regKey; + VncPasswdDialog passwd; + bool useNone; + bool useVNC; + }; + + }; + +}; + +#endif diff --git a/vncconfig/Connections.h b/vncconfig/Connections.h new file mode 100644 index 00000000..133e81c1 --- /dev/null +++ b/vncconfig/Connections.h @@ -0,0 +1,278 @@ +/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ +#ifndef WINVNCCONF_CONNECTIONS +#define WINVNCCONF_CONNECTIONS + +#include <vector> + +#include <rfb_win32/Registry.h> +#include <rfb_win32/Dialog.h> +#include <rfb/Configuration.h> +#include <rfb/Blacklist.h> +#include <network/TcpSocket.h> + +static rfb::IntParameter http_port("HTTPPortNumber", + "TCP/IP port on which the server will serve the Java applet VNC Viewer ", 5800); +static rfb::IntParameter port_number("PortNumber", + "TCP/IP port on which the server will accept connections", 5900); +static rfb::StringParameter hosts("Hosts", + "Filter describing which hosts are allowed access to this server", "+"); +static rfb::BoolParameter localHost("LocalHost", + "Only accept connections from via the local loop-back network interface", false); + +namespace rfb { + + namespace win32 { + + class ConnHostDialog : public Dialog { + public: + ConnHostDialog() : Dialog(GetModuleHandle(0)) {} + bool showDialog(const TCHAR* pat) { + delete [] pattern.buf; + pattern.buf = tstrDup(pat); + return Dialog::showDialog(MAKEINTRESOURCE(IDD_CONN_HOST)); + } + void initDialog() { + if (_tcslen(pattern.buf) == 0) { + delete [] pattern.buf; + pattern.buf = tstrDup(_T("+")); + } + + if (pattern.buf[0] == _T('+')) + setItemChecked(IDC_ALLOW, true); + else + setItemChecked(IDC_DENY, true); + + setItemString(IDC_HOST_PATTERN, &pattern.buf[1]); + + delete [] pattern.buf; + pattern.buf = 0; + } + bool onOk() { + delete [] pattern.buf; + pattern.buf = 0; + + TCharArray host = getItemString(IDC_HOST_PATTERN); + + TCharArray newPat(_tcslen(host.buf)+2); + if (isItemChecked(IDC_ALLOW)) + newPat.buf[0] = _T('+'); + else + newPat.buf[0] = _T('-'); + newPat.buf[1] = 0; + _tcscat(newPat.buf, host.buf); + + network::TcpFilter::Pattern pat = network::TcpFilter::parsePattern(CStr(newPat.buf)); + pattern.buf = TCharArray(network::TcpFilter::patternToStr(pat)).takeBuf(); + return true; + } + const TCHAR* getPattern() {return pattern.buf;} + protected: + TCharArray pattern; + }; + + class ConnectionsPage : public PropSheetPage { + public: + ConnectionsPage(const RegKey& rk) + : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_CONNECTIONS)), regKey(rk) {} + void initDialog() { + vlog.debug("set IDC_PORT %d", (int)port_number); + setItemInt(IDC_PORT, port_number); + setItemInt(IDC_IDLE_TIMEOUT, rfb::Server::idleTimeout); + vlog.debug("set IDC_HTTP_PORT %d", (int)http_port); + setItemInt(IDC_HTTP_PORT, http_port); + setItemChecked(IDC_HTTP_ENABLE, http_port != 0); + enableItem(IDC_HTTP_PORT, http_port != 0); + setItemChecked(IDC_LOCALHOST, localHost); + + HWND listBox = GetDlgItem(handle, IDC_HOSTS); + while (SendMessage(listBox, LB_GETCOUNT, 0, 0)) + SendMessage(listBox, LB_DELETESTRING, 0, 0); + + CharArray tmp; + tmp.buf = hosts.getData(); + while (tmp.buf) { + CharArray first; + strSplit(tmp.buf, ',', &first.buf, &tmp.buf); + if (strlen(first.buf)) + SendMessage(listBox, LB_ADDSTRING, 0, (LPARAM)(const TCHAR*)TStr(first.buf)); + } + + onCommand(IDC_HOSTS, EN_CHANGE); + } + bool onCommand(int id, int cmd) { + switch (id) { + case IDC_HOSTS: + { + DWORD selected = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCURSEL, 0, 0); + int count = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCOUNT, 0, 0); + bool enable = selected != LB_ERR; + enableItem(IDC_HOST_REMOVE, enable); + enableItem(IDC_HOST_UP, enable && (selected > 0)); + enableItem(IDC_HOST_DOWN, enable && (selected < count-1)); + enableItem(IDC_HOST_EDIT, enable); + setChanged(isChanged()); + } + return true; + + case IDC_PORT: + if (cmd == EN_CHANGE) { + try { + if (getItemInt(IDC_PORT) > 100) + setItemInt(IDC_HTTP_PORT, getItemInt(IDC_PORT)-100); + } catch (...) { + } + } + case IDC_HTTP_PORT: + case IDC_IDLE_TIMEOUT: + if (cmd == EN_CHANGE) + setChanged(isChanged()); + return false; + + case IDC_HTTP_ENABLE: + enableItem(IDC_HTTP_PORT, isItemChecked(IDC_HTTP_ENABLE)); + setChanged(isChanged()); + return false; + + case IDC_LOCALHOST: + enableItem(IDC_HOSTS, !isItemChecked(IDC_LOCALHOST)); + enableItem(IDC_HOST_REMOVE, !isItemChecked(IDC_LOCALHOST)); + enableItem(IDC_HOST_UP, !isItemChecked(IDC_LOCALHOST)); + enableItem(IDC_HOST_DOWN, !isItemChecked(IDC_LOCALHOST)); + enableItem(IDC_HOST_EDIT, !isItemChecked(IDC_LOCALHOST)); + enableItem(IDC_HOST_ADD, !isItemChecked(IDC_LOCALHOST)); + setChanged(isChanged()); + return false; + + case IDC_HOST_ADD: + if (hostDialog.showDialog(_T(""))) + { + const TCHAR* pattern = hostDialog.getPattern(); + if (pattern) + SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_ADDSTRING, 0, (LPARAM)pattern); + } + return true; + + case IDC_HOST_EDIT: + { + HWND listBox = GetDlgItem(handle, IDC_HOSTS); + int item = SendMessage(listBox, LB_GETCURSEL, 0, 0); + TCharArray pattern(SendMessage(listBox, LB_GETTEXTLEN, item, 0)+1); + SendMessage(listBox, LB_GETTEXT, item, (LPARAM)pattern.buf); + + if (hostDialog.showDialog(pattern.buf)) { + const TCHAR* newPat = hostDialog.getPattern(); + if (newPat) { + item = SendMessage(listBox, LB_FINDSTRINGEXACT, item, (LPARAM)pattern.buf); + if (item != LB_ERR) { + SendMessage(listBox, LB_DELETESTRING, item, 0); + SendMessage(listBox, LB_INSERTSTRING, item, (LPARAM)newPat); + SendMessage(listBox, LB_SETCURSEL, item, 0); + onCommand(IDC_HOSTS, EN_CHANGE); + } + } + } + } + return true; + + case IDC_HOST_UP: + { + HWND listBox = GetDlgItem(handle, IDC_HOSTS); + int item = SendMessage(listBox, LB_GETCURSEL, 0, 0); + TCharArray pattern(SendMessage(listBox, LB_GETTEXTLEN, item, 0)+1); + SendMessage(listBox, LB_GETTEXT, item, (LPARAM)pattern.buf); + SendMessage(listBox, LB_DELETESTRING, item, 0); + SendMessage(listBox, LB_INSERTSTRING, item-1, (LPARAM)pattern.buf); + SendMessage(listBox, LB_SETCURSEL, item-1, 0); + onCommand(IDC_HOSTS, EN_CHANGE); + } + return true; + + case IDC_HOST_DOWN: + { + HWND listBox = GetDlgItem(handle, IDC_HOSTS); + int item = SendMessage(listBox, LB_GETCURSEL, 0, 0); + TCharArray pattern(SendMessage(listBox, LB_GETTEXTLEN, item, 0)+1); + SendMessage(listBox, LB_GETTEXT, item, (LPARAM)pattern.buf); + SendMessage(listBox, LB_DELETESTRING, item, 0); + SendMessage(listBox, LB_INSERTSTRING, item+1, (LPARAM)pattern.buf); + SendMessage(listBox, LB_SETCURSEL, item+1, 0); + onCommand(IDC_HOSTS, EN_CHANGE); + } + return true; + + case IDC_HOST_REMOVE: + { + HWND listBox = GetDlgItem(handle, IDC_HOSTS); + int item = SendMessage(listBox, LB_GETCURSEL, 0, 0); + SendMessage(listBox, LB_DELETESTRING, item, 0); + onCommand(IDC_HOSTS, EN_CHANGE); + } + + } + return false; + } + bool onOk() { + regKey.setInt(_T("PortNumber"), getItemInt(IDC_PORT)); + regKey.setInt(_T("LocalHost"), isItemChecked(IDC_LOCALHOST)); + regKey.setInt(_T("IdleTimeout"), getItemInt(IDC_IDLE_TIMEOUT)); + regKey.setInt(_T("HTTPPortNumber"), isItemChecked(IDC_HTTP_ENABLE) ? getItemInt(IDC_HTTP_PORT) : 0); + + regKey.setString(_T("Hosts"), TCharArray(getHosts()).buf); + return true; + } + bool isChanged() { + try { + CharArray new_hosts = getHosts(); + CharArray old_hosts = hosts.getData(); + return (strcmp(new_hosts.buf, old_hosts.buf) != 0) || + (localHost != isItemChecked(IDC_LOCALHOST)) || + (port_number != getItemInt(IDC_PORT)) || + (http_port != getItemInt(IDC_HTTP_PORT)) || + ((http_port!=0) != (isItemChecked(IDC_HTTP_ENABLE)!=0)) || + (rfb::Server::idleTimeout != getItemInt(IDC_IDLE_TIMEOUT)); + } catch (rdr::Exception) { + return false; + } + } + char* getHosts() { + int bufLen = 1, i; + HWND listBox = GetDlgItem(handle, IDC_HOSTS); + for (i=0; i<SendMessage(listBox, LB_GETCOUNT, 0, 0); i++) + bufLen+=SendMessage(listBox, LB_GETTEXTLEN, i, 0)+1; + TCharArray hosts_str(bufLen); + hosts_str.buf[0] = 0; + TCHAR* outPos = hosts_str.buf; + for (i=0; i<SendMessage(listBox, LB_GETCOUNT, 0, 0); i++) { + outPos += SendMessage(listBox, LB_GETTEXT, i, (LPARAM)outPos); + outPos[0] = ','; + outPos[1] = 0; + outPos++; + } + return strDup(hosts_str.buf); + } + protected: + RegKey regKey; + ConnHostDialog hostDialog; + }; + + }; + +}; + +#endif
\ No newline at end of file diff --git a/vncconfig/Desktop.h b/vncconfig/Desktop.h new file mode 100644 index 00000000..a0a325a3 --- /dev/null +++ b/vncconfig/Desktop.h @@ -0,0 +1,93 @@ +/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ +#ifndef WINVNCCONF_DESKTOP +#define WINVNCCONF_DESKTOP + +#include <rfb_win32/Registry.h> +#include <rfb_win32/Dialog.h> +#include <rfb_win32/SDisplay.h> + +namespace rfb { + + namespace win32 { + + class DesktopPage : public PropSheetPage { + public: + DesktopPage(const RegKey& rk) + : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_DESKTOP)), regKey(rk) {} + void initDialog() { + CharArray action = rfb::win32::SDisplay::disconnectAction.getData(); + bool disconnectLock = stricmp(action.buf, "Lock") == 0; + bool disconnectLogoff = stricmp(action.buf, "Logoff") == 0; + typedef BOOL (WINAPI *_LockWorkStation_proto)(); + DynamicFn<_LockWorkStation_proto> _LockWorkStation(_T("user32.dll"), "LockWorkStation"); + if (!_LockWorkStation.isValid()) { + enableItem(IDC_DISCONNECT_LOCK, false); + if (disconnectLock) { + disconnectLogoff = true; + disconnectLock = false; + } + } + setItemChecked(IDC_DISCONNECT_LOGOFF, disconnectLogoff); + setItemChecked(IDC_DISCONNECT_LOCK, disconnectLock); + setItemChecked(IDC_DISCONNECT_NONE, !disconnectLock && !disconnectLogoff); + setItemChecked(IDC_REMOVE_WALLPAPER, rfb::win32::SDisplay::removeWallpaper); + setItemChecked(IDC_REMOVE_PATTERN, rfb::win32::SDisplay::removePattern); + setItemChecked(IDC_DISABLE_EFFECTS, rfb::win32::SDisplay::disableEffects); + } + bool onCommand(int id, int cmd) { + switch (id) { + case IDC_DISCONNECT_LOGOFF: + case IDC_DISCONNECT_LOCK: + case IDC_DISCONNECT_NONE: + case IDC_REMOVE_WALLPAPER: + case IDC_REMOVE_PATTERN: + case IDC_DISABLE_EFFECTS: + CharArray action = rfb::win32::SDisplay::disconnectAction.getData(); + bool disconnectLock = stricmp(action.buf, "Lock") == 0; + bool disconnectLogoff = stricmp(action.buf, "Logoff") == 0; + setChanged((disconnectLogoff != isItemChecked(IDC_DISCONNECT_LOGOFF)) || + (disconnectLock != isItemChecked(IDC_DISCONNECT_LOCK)) || + (isItemChecked(IDC_REMOVE_WALLPAPER) != rfb::win32::SDisplay::removeWallpaper) || + (isItemChecked(IDC_REMOVE_PATTERN) != rfb::win32::SDisplay::removePattern) || + (isItemChecked(IDC_DISABLE_EFFECTS) != rfb::win32::SDisplay::disableEffects)); + break; + } + return false; + } + bool onOk() { + const TCHAR* action = _T("None"); + if (isItemChecked(IDC_DISCONNECT_LOGOFF)) + action = _T("Logoff"); + else if (isItemChecked(IDC_DISCONNECT_LOCK)) + action = _T("Lock"); + regKey.setString(_T("DisconnectAction"), action); + regKey.setBool(_T("RemoveWallpaper"), isItemChecked(IDC_REMOVE_WALLPAPER)); + regKey.setBool(_T("RemovePattern"), isItemChecked(IDC_REMOVE_PATTERN)); + regKey.setBool(_T("DisableEffects"), isItemChecked(IDC_DISABLE_EFFECTS)); + return true; + } + protected: + RegKey regKey; + }; + + }; + +}; + +#endif
\ No newline at end of file diff --git a/vncconfig/Hooking.h b/vncconfig/Hooking.h new file mode 100644 index 00000000..b9bec15a --- /dev/null +++ b/vncconfig/Hooking.h @@ -0,0 +1,65 @@ +/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ +#ifndef WINVNCCONF_HOOKING +#define WINVNCCONF_HOOKING + +#include <rfb_win32/Registry.h> +#include <rfb_win32/Dialog.h> +#include <rfb_win32/SDisplay.h> +#include <rfb/ServerCore.h> + +namespace rfb { + + namespace win32 { + + class HookingPage : public PropSheetPage { + public: + HookingPage(const RegKey& rk) + : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_HOOKING)), regKey(rk) {} + void initDialog() { + setItemChecked(IDC_USEHOOKS, rfb::win32::SDisplay::use_hooks); + setItemChecked(IDC_POLLCONSOLES, rfb::win32::WMPoller::poll_console_windows); + setItemChecked(IDC_COMPAREFB, rfb::Server::compareFB); + } + bool onCommand(int id, int cmd) { + switch (id) { + case IDC_USEHOOKS: + case IDC_POLLCONSOLES: + case IDC_COMPAREFB: + setChanged((rfb::win32::SDisplay::use_hooks != isItemChecked(IDC_USEHOOKS)) || + (rfb::win32::WMPoller::poll_console_windows != isItemChecked(IDC_POLLCONSOLES)) || + (rfb::Server::compareFB != isItemChecked(IDC_COMPAREFB))); + break; + } + return false; + } + bool onOk() { + regKey.setBool(_T("UseHooks"), isItemChecked(IDC_USEHOOKS)); + regKey.setBool(_T("PollConsoleWindows"), isItemChecked(IDC_POLLCONSOLES)); + regKey.setBool(_T("CompareFB"), isItemChecked(IDC_COMPAREFB)); + return true; + } + protected: + RegKey regKey; + }; + + }; + +}; + +#endif
\ No newline at end of file diff --git a/vncconfig/Inputs.h b/vncconfig/Inputs.h new file mode 100644 index 00000000..2735d24a --- /dev/null +++ b/vncconfig/Inputs.h @@ -0,0 +1,84 @@ +/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ +#ifndef WINVNCCONF_INPUTS +#define WINVNCCONF_INPUTS + +#ifndef SPI_GETBLOCKSENDINPUTRESETS +#define SPI_GETBLOCKSENDINPUTRESETS 0x1026 +#define SPI_SETBLOCKSENDINPUTRESETS 0x1027 +#endif + +#include <rfb_win32/Registry.h> +#include <rfb_win32/Dialog.h> +#include <rfb/ServerCore.h> + +namespace rfb { + + namespace win32 { + + class InputsPage : public PropSheetPage { + public: + InputsPage(const RegKey& rk) + : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_INPUTS)), + regKey(rk), enableAffectSSaver(true) {} + void initDialog() { + setItemChecked(IDC_ACCEPT_KEYS, rfb::Server::acceptKeyEvents); + setItemChecked(IDC_ACCEPT_PTR, rfb::Server::acceptPointerEvents); + setItemChecked(IDC_ACCEPT_CUTTEXT, rfb::Server::acceptCutText); + setItemChecked(IDC_SEND_CUTTEXT, rfb::Server::sendCutText); + setItemChecked(IDC_DISABLE_LOCAL_INPUTS, SDisplay::disableLocalInputs); + BOOL blocked = FALSE; + if (SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &blocked, 0)) + setItemChecked(IDC_AFFECT_SCREENSAVER, !blocked); + else + enableAffectSSaver = false; + enableItem(IDC_AFFECT_SCREENSAVER, enableAffectSSaver); + } + bool onCommand(int id, int cmd) { + BOOL inputResetsBlocked; + SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &inputResetsBlocked, 0); + setChanged((rfb::Server::acceptKeyEvents != isItemChecked(IDC_ACCEPT_KEYS)) || + (rfb::Server::acceptPointerEvents != isItemChecked(IDC_ACCEPT_PTR)) || + (rfb::Server::acceptCutText != isItemChecked(IDC_ACCEPT_CUTTEXT)) || + (rfb::Server::sendCutText != isItemChecked(IDC_SEND_CUTTEXT)) || + (SDisplay::disableLocalInputs != isItemChecked(IDC_DISABLE_LOCAL_INPUTS)) || + (enableAffectSSaver && (!inputResetsBlocked != isItemChecked(IDC_AFFECT_SCREENSAVER)))); + return false; + } + bool onOk() { + regKey.setBool(_T("AcceptKeyEvents"), isItemChecked(IDC_ACCEPT_KEYS)); + regKey.setBool(_T("AcceptPointerEvents"), isItemChecked(IDC_ACCEPT_PTR)); + regKey.setBool(_T("AcceptCutText"), isItemChecked(IDC_ACCEPT_CUTTEXT)); + regKey.setBool(_T("SendCutText"), isItemChecked(IDC_SEND_CUTTEXT)); + regKey.setBool(_T("DisableLocalInputs"), isItemChecked(IDC_DISABLE_LOCAL_INPUTS)); + if (enableAffectSSaver) { + BOOL blocked = !isItemChecked(IDC_AFFECT_SCREENSAVER); + SystemParametersInfo(SPI_SETBLOCKSENDINPUTRESETS, blocked, 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); + } + return true; + } + protected: + RegKey regKey; + bool enableAffectSSaver; + }; + + }; + +}; + +#endif
\ No newline at end of file diff --git a/vncconfig/Legacy.cxx b/vncconfig/Legacy.cxx new file mode 100644 index 00000000..59266514 --- /dev/null +++ b/vncconfig/Legacy.cxx @@ -0,0 +1,248 @@ +/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#include <vncconfig/Legacy.h> + +#include <rfb/LogWriter.h> +#include <rfb_win32/CurrentUser.h> + +using namespace rfb; +using namespace win32; + +static LogWriter vlog("Legacy"); + + +void LegacyPage::LoadPrefs() + { + // VNC 3.3.3R3 Preferences Algorithm, as described by vncProperties.cpp + // - Load user-specific settings, based on logged-on user name, + // from HKLM/Software/ORL/WinVNC3/<user>. If they don't exist, + // try again with username "Default". + // - Load system-wide settings from HKLM/Software/ORL/WinVNC3. + // - If AllowProperties is non-zero then load the user's own + // settings from HKCU/Software/ORL/WinVNC3. + + // Get the name of the current user + TCharArray username; + try { + UserName name; + username.buf = name.takeBuf(); + } catch (rdr::SystemException& e) { + if (e.err != ERROR_NOT_LOGGED_ON) + throw; + } + + // Open and read the WinVNC3 registry key + allowProperties = true; + RegKey winvnc3; + try { + winvnc3.openKey(HKEY_LOCAL_MACHINE, _T("Software\\ORL\\WinVNC3")); + int debugMode = winvnc3.getInt(_T("DebugMode"), 0); + const char* debugTarget = 0; + if (debugMode & 2) debugTarget = "file"; + if (debugMode & 4) debugTarget = "stderr"; + if (debugTarget) { + char logSetting[32]; + sprintf(logSetting, "*:%s:%d", debugTarget, winvnc3.getInt(_T("DebugLevel"), 0)); + regKey.setString(_T("Log"), TStr(logSetting)); + } + + TCharArray authHosts; + authHosts.buf = winvnc3.getString(_T("AuthHosts"), 0); + if (authHosts.buf) { + CharArray newHosts; + newHosts.buf = strDup(""); + + // Reformat AuthHosts to Hosts. Wish I'd left the format the same. :( :( :( + try { + CharArray tmp = strDup(authHosts.buf); + while (tmp.buf) { + + // Split the AuthHosts string into patterns to match + CharArray first; + rfb::strSplit(tmp.buf, ':', &first.buf, &tmp.buf); + if (strlen(first.buf)) { + int bits = 0; + CharArray pattern(1+4*4+4); + pattern.buf[0] = first.buf[0]; + pattern.buf[1] = 0; + + // Split the pattern into IP address parts and process + rfb::CharArray address; + address.buf = rfb::strDup(&first.buf[1]); + while (address.buf) { + rfb::CharArray part; + rfb::strSplit(address.buf, '.', &part.buf, &address.buf); + if (bits) + strcat(pattern.buf, "."); + if (strlen(part.buf) > 3) + throw rdr::Exception("Invalid IP address part"); + if (strlen(part.buf) > 0) { + strcat(pattern.buf, part.buf); + bits += 8; + } + } + + // Pad out the address specification if required + int addrBits = bits; + while (addrBits < 32) { + if (addrBits) strcat(pattern.buf, "."); + strcat(pattern.buf, "0"); + addrBits += 8; + } + + // Append the number of bits to match + char buf[4]; + sprintf(buf, "/%d", bits); + strcat(pattern.buf, buf); + + // Append this pattern to the Hosts value + int length = strlen(newHosts.buf) + strlen(pattern.buf) + 2; + CharArray tmpHosts(length); + strcpy(tmpHosts.buf, pattern.buf); + if (strlen(newHosts.buf)) { + strcat(tmpHosts.buf, ","); + strcat(tmpHosts.buf, newHosts.buf); + } + delete [] newHosts.buf; + newHosts.buf = tmpHosts.takeBuf(); + } + } + + // Finally, save the Hosts value + regKey.setString(_T("Hosts"), TStr(newHosts.buf)); + } catch (rdr::Exception) { + MsgBox(0, _T("Unable to convert AuthHosts setting to Hosts format."), + MB_ICONWARNING | MB_OK); + } + } else { + regKey.setString(_T("Hosts"), _T("+")); + } + + regKey.setBool(_T("LocalHost"), winvnc3.getBool(_T("LoopbackOnly"), false)); + // *** check AllowLoopback? + + if (winvnc3.getBool(_T("AuthRequired"), true)) + regKey.setString(_T("SecurityTypes"), _T("VncAuth")); + else + regKey.setString(_T("SecurityTypes"), _T("None")); + + int connectPriority = winvnc3.getInt(_T("ConnectPriority"), 0); + regKey.setBool(_T("DisconnectClients"), connectPriority == 0); + regKey.setBool(_T("AlwaysShared"), connectPriority == 1); + regKey.setBool(_T("NeverShared"), connectPriority == 2); + + } catch(rdr::Exception) { + } + + // Open the local, default-user settings + allowProperties = true; + try { + RegKey userKey; + userKey.openKey(winvnc3, _T("Default")); + vlog.info("loading Default prefs"); + LoadUserPrefs(userKey); + } catch(rdr::Exception& e) { + vlog.error("error reading Default settings:%s", e.str()); + } + + // Open the local, user-specific settings + if (userSettings && username.buf) { + try { + RegKey userKey; + userKey.openKey(winvnc3, username.buf); + vlog.info("loading local User prefs"); + LoadUserPrefs(userKey); + } catch(rdr::Exception& e) { + vlog.error("error reading local User settings:%s", e.str()); + } + + // Open the user's own settings + if (allowProperties) { + try { + RegKey userKey; + userKey.openKey(HKEY_CURRENT_USER, _T("Software\\ORL\\WinVNC3")); + vlog.info("loading global User prefs"); + LoadUserPrefs(userKey); + } catch(rdr::Exception& e) { + vlog.error("error reading global User settings:%s", e.str()); + } + } + } + + // Disable the Options menu item if appropriate + regKey.setBool(_T("DisableOptions"), !allowProperties); + } + + void LegacyPage::LoadUserPrefs(const RegKey& key) + { + if (key.getBool(_T("HTTPConnect"), true)) + regKey.setInt(_T("HTTPPortNumber"), key.getInt(_T("PortNumber"), 5900)-100); + else + regKey.setInt(_T("HTTPPortNumber"), 0); + regKey.setInt(_T("PortNumber"), key.getBool(_T("SocketConnect")) ? key.getInt(_T("PortNumber"), 5900) : 0); + if (key.getBool(_T("AutoPortSelect"), false)) { + MsgBox(0, _T("The AutoPortSelect setting is not supported by this release.") + _T("The port number will default to 5900."), + MB_ICONWARNING | MB_OK); + regKey.setInt(_T("PortNumber"), 5900); + } + regKey.setInt(_T("IdleTimeout"), key.getInt(_T("IdleTimeout"), 0)); + + regKey.setBool(_T("RemoveWallpaper"), key.getBool(_T("RemoveWallpaper"))); + regKey.setBool(_T("RemovePattern"), key.getBool(_T("RemoveWallpaper"))); + regKey.setBool(_T("DisableEffects"), key.getBool(_T("RemoveWallpaper"))); + + if (key.getInt(_T("QuerySetting"), 2) != 2) { + regKey.setBool(_T("QueryConnect"), key.getInt(_T("QuerySetting")) > 2); + MsgBox(0, _T("The QuerySetting option has been replaced by QueryConnect.") + _T("Please see the documentation for details of the QueryConnect option."), + MB_ICONWARNING | MB_OK); + } + regKey.setInt(_T("QueryTimeout"), key.getInt(_T("QueryTimeout"), 10)); + + rfb::CharArray passwd; + int length; + key.getBinary(_T("Password"), (void**)&passwd.buf, &length, 0, 0); + regKey.setBinary(_T("Password"), passwd.buf, length); + + bool enableInputs = key.getBool(_T("InputsEnabled"), true); + regKey.setBool(_T("AcceptKeyEvents"), enableInputs); + regKey.setBool(_T("AcceptPointerEvents"), enableInputs); + regKey.setBool(_T("AcceptCutText"), enableInputs); + regKey.setBool(_T("SendCutText"), enableInputs); + + switch (key.getInt(_T("LockSetting"), 0)) { + case 0: regKey.setString(_T("DisconnectAction"), _T("None")); break; + case 1: regKey.setString(_T("DisconnectAction"), _T("Lock")); break; + case 2: regKey.setString(_T("DisconnectAction"), _T("Logoff")); break; + }; + + regKey.setBool(_T("DisableLocalInputs"), key.getBool(_T("LocalInputsDisabled"), false)); + + // *** ignore polling preferences + // PollUnderCursor, PollForeground, OnlyPollConsole, OnlyPollOnEvent + regKey.setBool(_T("UseHooks"), !key.getBool(_T("PollFullScreen"), false)); + + if (key.isValue(_T("AllowShutdown"))) + MsgBox(0, _T("The AllowShutdown option is not supported by this release."), MB_ICONWARNING | MB_OK); + if (key.isValue(_T("AllowEditClients"))) + MsgBox(0, _T("The AllowEditClients option is not supported by this release."), MB_ICONWARNING | MB_OK); + + allowProperties = key.getBool(_T("AllowProperties"), allowProperties); + } diff --git a/vncconfig/Legacy.h b/vncconfig/Legacy.h new file mode 100644 index 00000000..e66dc56b --- /dev/null +++ b/vncconfig/Legacy.h @@ -0,0 +1,86 @@ +/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#ifndef WINVNCCONF_LEGACY +#define WINVNCCONF_LEGACY + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <lmcons.h> + +#include <vncconfig/resource.h> +#include <rfb_win32/Registry.h> +#include <rfb_win32/Dialog.h> +#include <rfb_win32/Win32Util.h> +#include <rfb/ServerCore.h> + +namespace rfb { + + namespace win32 { + + class LegacyPage : public PropSheetPage { + public: + LegacyPage(const RegKey& rk, bool userSettings_) + : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_LEGACY)), regKey(rk), userSettings(userSettings_) {} + void initDialog() { + setItemChecked(IDC_PROTOCOL_3_3, rfb::Server::protocol3_3); + } + bool onCommand(int id, int cmd) { + switch (id) { + case IDC_LEGACY_IMPORT: + { + DWORD result = MsgBox(0, + _T("Importing your legacy VNC 3.3 settings will overwrite your existing settings.\n") + _T("Are you sure you wish to continue?"), + MB_ICONWARNING | MB_YESNO); + if (result == IDYES) { + LoadPrefs(); + MsgBox(0, _T("Imported VNC 3.3 settings successfully."), + MB_ICONINFORMATION | MB_OK); + + // Sleep to allow RegConfig thread to reload settings + Sleep(1000); + propSheet->reInitPages(); + } + } + return true; + case IDC_PROTOCOL_3_3: + setChanged(isItemChecked(IDC_PROTOCOL_3_3) != rfb::Server::protocol3_3); + return false; + }; + return false; + } + bool onOk() { + regKey.setBool(_T("Protocol3.3"), isItemChecked(IDC_PROTOCOL_3_3)); + return true; + } + + void LoadPrefs(); + void LoadUserPrefs(const RegKey& key); + + protected: + bool allowProperties; + RegKey regKey; + bool userSettings; + }; + + }; + +}; + +#endif
\ No newline at end of file diff --git a/vncconfig/Sharing.h b/vncconfig/Sharing.h new file mode 100644 index 00000000..b63b39ad --- /dev/null +++ b/vncconfig/Sharing.h @@ -0,0 +1,59 @@ +/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ +#ifndef WINVNCCONF_SHARING +#define WINVNCCONF_SHARING + +#include <rfb_win32/Registry.h> +#include <rfb_win32/Dialog.h> +#include <rfb/ServerCore.h> + +namespace rfb { + + namespace win32 { + + class SharingPage : public PropSheetPage { + public: + SharingPage(const RegKey& rk) + : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_SHARING)), regKey(rk) {} + void initDialog() { + setItemChecked(IDC_DISCONNECT_CLIENTS, rfb::Server::disconnectClients); + setItemChecked(IDC_SHARE_NEVER, rfb::Server::neverShared); + setItemChecked(IDC_SHARE_ALWAYS, rfb::Server::alwaysShared); + setItemChecked(IDC_SHARE_CLIENT, !(rfb::Server::neverShared || rfb::Server::alwaysShared)); + } + bool onCommand(int id, int cmd) { + setChanged((isItemChecked(IDC_DISCONNECT_CLIENTS) != rfb::Server::disconnectClients) || + (isItemChecked(IDC_SHARE_NEVER) != rfb::Server::neverShared) || + (isItemChecked(IDC_SHARE_ALWAYS) != rfb::Server::alwaysShared)); + return true; + } + bool onOk() { + regKey.setBool(_T("DisconnectClients"), isItemChecked(IDC_DISCONNECT_CLIENTS)); + regKey.setBool(_T("AlwaysShared"), isItemChecked(IDC_SHARE_ALWAYS)); + regKey.setBool(_T("NeverShared"), isItemChecked(IDC_SHARE_NEVER)); + return true; + } + protected: + RegKey regKey; + }; + + }; + +}; + +#endif
\ No newline at end of file diff --git a/vncconfig/resource.h b/vncconfig/resource.h new file mode 100644 index 00000000..99e2cea3 --- /dev/null +++ b/vncconfig/resource.h @@ -0,0 +1,86 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by vncconfig.rc +// +#define IDR_MANIFEST 1 +#define IDI_ICON 101 +#define IDD_DIALOG1 102 +#define IDD_DIALOG2 103 +#define IDD_SECURITY 104 +#define IDD_AUTHENTICATION 104 +#define IDD_CONNECTIONS 105 +#define IDD_HOOKING 106 +#define IDD_VNC_PASSWD 107 +#define IDD_AUTH_VNC_PASSWD 107 +#define IDD_LEGACY 108 +#define IDD_CONN_HOST 109 +#define IDD_SHARING 110 +#define IDD_INPUTS 111 +#define IDR_TRAY 112 +#define IDD_ABOUT 113 +#define IDI_CONNECTED 115 +#define IDD_DESKTOP 116 +#define IDC_EDIT1 1000 +#define IDC_PORT 1000 +#define IDC_PASSWORD1 1000 +#define IDC_HOST_PATTERN 1000 +#define IDC_AUTH_NONE 1002 +#define IDC_AUTH_VNC 1003 +#define IDC_AUTH_VNC_PASSWD 1009 +#define IDC_USEHOOKS 1011 +#define IDC_POLLCONSOLES 1012 +#define IDC_COMPAREFB 1013 +#define IDC_IDLE_TIMEOUT 1015 +#define IDC_HOSTS 1016 +#define IDC_HOST_ADD 1017 +#define IDC_HOST_REMOVE 1018 +#define IDC_HOST_UP 1019 +#define IDC_BUTTON4 1020 +#define IDC_HOST_DOWN 1020 +#define IDC_HOST_EDIT 1021 +#define IDC_PASSWORD2 1022 +#define IDC_LEGACY_IMPORT 1023 +#define IDC_ALLOW 1024 +#define IDC_DENY 1025 +#define IDC_SHARE_ALWAYS 1030 +#define IDC_SHARE_NEVER 1031 +#define IDC_SHARE_CLIENT 1032 +#define IDC_DISCONNECT_CLIENTS 1033 +#define IDC_ACCEPT_KEYS 1034 +#define IDC_ACCEPT_PTR 1035 +#define IDC_ACCEPT_CUTTEXT 1036 +#define IDC_SEND_CUTTEXT 1037 +#define IDC_PROTOCOL_3_3 1038 +#define IDC_DESCRIPTION 1039 +#define IDC_BUILDTIME 1040 +#define IDC_VERSION 1041 +#define IDC_COPYRIGHT 1042 +#define IDC_HTTP_ENABLE 1043 +#define IDC_HTTP_PORT 1044 +#define A 1045 +#define IDC_BL_THRESHOLD 1046 +#define IDC_BL_TIMEOUT 1047 +#define IDC_AFFECT_SCREENSAVER 1048 +#define IDC_LOCALHOST 1049 +#define IDC_DISABLE_LOCAL_INPUTS 1050 +#define IDC_QUERY_CONNECT 1051 +#define IDC_DISCONNECT_NONE 1056 +#define IDC_DISCONNECT_LOCK 1057 +#define IDC_DISCONNECT_LOGOFF 1058 +#define IDC_REMOVE_WALLPAPER 1059 +#define IDC_REMOVE_PATTERN 1060 +#define IDC_DISABLE_EFFECTS 1061 +#define ID_OPTIONS 40001 +#define ID_CLOSE 40002 +#define ID_ABOUT 40003 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 117 +#define _APS_NEXT_COMMAND_VALUE 40004 +#define _APS_NEXT_CONTROL_VALUE 1062 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/vncconfig/vncconfig.cxx b/vncconfig/vncconfig.cxx new file mode 100644 index 00000000..2a98dbca --- /dev/null +++ b/vncconfig/vncconfig.cxx @@ -0,0 +1,193 @@ +/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <commctrl.h> +#include <string.h> +#ifdef WIN32 +#define strcasecmp _stricmp +#endif + +#include "resource.h" +#include <rfb/Logger_stdio.h> +#include <rfb/LogWriter.h> +#include <rfb/SSecurityFactoryStandard.h> +#include <rfb_win32/Dialog.h> +#include <rfb_win32/RegConfig.h> +#include <rfb_win32/CurrentUser.h> + +using namespace rfb; +using namespace rfb::win32; + +static LogWriter vlog("main"); + + +#include <vncconfig/Authentication.h> +#include <vncconfig/Connections.h> +#include <vncconfig/Sharing.h> +#include <vncconfig/Hooking.h> +#include <vncconfig/Inputs.h> +#include <vncconfig/Legacy.h> +#include <vncconfig/Desktop.h> + + +TStr rfb::win32::AppName("VNC Config"); + + +VncAuthPasswdConfigParameter vncAuthPasswd; + +#ifdef _DEBUG +BoolParameter captureDialogs("CaptureDialogs", "", false); +#endif + +HKEY configKey = HKEY_CURRENT_USER; + + +void +processParams(int argc, char* argv[]) { + for (int i=1; i<argc; i++) { + if (strcasecmp(argv[i], "-service") == 0) { + configKey = HKEY_LOCAL_MACHINE; + } else if (strcasecmp(argv[i], "-user") == 0) { + configKey = HKEY_CURRENT_USER; + } else { + // Try to process <option>=<value>, or -<bool> + if (Configuration::setParam(argv[i], true)) + continue; + // Try to process -<option> <value> + if ((argv[i][0] == '-') && (i+1 < argc)) { + if (Configuration::setParam(&argv[i][1], argv[i+1], true)) { + i++; + continue; + } + } + } + } +} + + +int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, char* cmdLine, int cmdShow) { + + // Configure debugging output +#ifdef _DEBUG + AllocConsole(); + freopen("CONIN$","rb",stdin); + freopen("CONOUT$","wb",stdout); + freopen("CONOUT$","wb",stderr); + setbuf(stderr, 0); + initStdIOLoggers(); + LogWriter vlog("main"); + logParams.setParam("*:stderr:100"); + vlog.info("Starting vncconfig applet"); +#endif + + try { + try { + // Process command-line args + int argc = __argc; + char** argv = __argv; + processParams(argc, argv); + + /* *** Required if we wish to use IP address control + INITCOMMONCONTROLSEX icce; + icce.dwSize = sizeof(icce); + icce.dwICC = ICC_INTERNET_CLASSES; + InitCommonControlsEx(&icce); + */ + + // Create the required configuration registry key + RegKey rootKey; + rootKey.createKey(configKey, _T("Software\\RealVNC\\WinVNC4")); + + // Override whatever security it already had (NT only) + bool warnOnChangePassword = false; + try { + AccessEntries access; + Sid adminSID = Sid::Administrators(); + Sid systemSID = Sid::SYSTEM(); + access.addEntry(adminSID, KEY_ALL_ACCESS, GRANT_ACCESS); + access.addEntry(systemSID, KEY_ALL_ACCESS, GRANT_ACCESS); + UserName user; + if (configKey == HKEY_CURRENT_USER) + access.addEntry(user.buf, KEY_ALL_ACCESS, GRANT_ACCESS); + AccessControlList acl = CreateACL(access); + + // Set the DACL, and don't allow the key to inherit its parent's DACL + rootKey.setDACL(acl, false); + } catch (rdr::SystemException& e) { + // Something weird happens on NT 4.0 SP5 but I can't reproduce it on other + // NT 4.0 service pack revisions. + if (e.err == ERROR_INVALID_PARAMETER) { + MsgBox(0, _T("Windows reported an error trying to secure the VNC Server settings for this user. ") + _T("Your settings may not be secure!"), MB_ICONWARNING | MB_OK); + } else if (e.err != ERROR_CALL_NOT_IMPLEMENTED && + e.err != ERROR_NOT_LOGGED_ON) { + // If the call is not implemented, ignore the error and continue + // If we are on Win9x and no user is logged on, ignore error and continue + throw; + } + warnOnChangePassword = true; + } + + // Start the RegConfig reader, to load in existing settings + RegistryReader config; + config.setKey(configKey, _T("Software\\RealVNC\\WinVNC4")); + + // Build the dialog + std::list<PropSheetPage*> pages; + AuthenticationPage auth(rootKey); pages.push_back(&auth); + auth.setWarnPasswdInsecure(warnOnChangePassword); + ConnectionsPage conn(rootKey); pages.push_back(&conn); + InputsPage inputs(rootKey); pages.push_back(&inputs); + SharingPage sharing(rootKey); pages.push_back(&sharing); + DesktopPage desktop(rootKey); pages.push_back(&desktop); + HookingPage hooks(rootKey); pages.push_back(&hooks); + LegacyPage legacy(rootKey, configKey == HKEY_CURRENT_USER); pages.push_back(&legacy); + + // Load the default icon to use + HICON icon = (HICON)LoadImage(inst, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 0, 0, LR_SHARED); + + // Create the PropertySheet handler + TCHAR* propSheetTitle = _T("VNC Server Properties (Service-Mode)"); + if (configKey == HKEY_CURRENT_USER) + propSheetTitle = _T("VNC Server Properties (User-Mode)"); + PropSheet sheet(inst, propSheetTitle, pages, icon); + +#ifdef _DEBUG + vlog.debug("capture dialogs=%s", captureDialogs ? "true" : "false"); + sheet.showPropSheet(0, true, false, captureDialogs); +#else + sheet.showPropSheet(0, true, false); +#endif + + return 0; + } catch (rdr::SystemException& e) { + switch (e.err) { + case ERROR_ACCESS_DENIED: + MsgBox(0, _T("You do not have sufficient access rights to run the VNC Configuration applet"), + MB_ICONSTOP | MB_OK); + return 1; + }; + throw; + } + } catch (rdr::Exception& e) { + MsgBox(NULL, TStr(e.str()), MB_ICONEXCLAMATION | MB_OK); + return 1; + } +} diff --git a/vncconfig/vncconfig.dsp b/vncconfig/vncconfig.dsp new file mode 100644 index 00000000..b557dfae --- /dev/null +++ b/vncconfig/vncconfig.dsp @@ -0,0 +1,188 @@ +# Microsoft Developer Studio Project File - Name="vncconfig" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=vncconfig - Win32 Debug Unicode +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "vncconfig.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "vncconfig.mak" CFG="vncconfig - Win32 Debug Unicode" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "vncconfig - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "vncconfig - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE "vncconfig - Win32 Debug Unicode" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "vncconfig - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".." /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "_MBCS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 user32.lib gdi32.lib advapi32.lib version.lib shell32.lib comctl32.lib ws2_32.lib ole32.lib /nologo /subsystem:windows /machine:I386 + +!ELSEIF "$(CFG)" == "vncconfig - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "vncconfig___Win32_Debug" +# PROP BASE Intermediate_Dir "vncconfig___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".." /D "_DEBUG" /D "_WINDOWS" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 user32.lib gdi32.lib advapi32.lib version.lib shell32.lib comctl32.lib ws2_32.lib ole32.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /pdbtype:sept + +!ELSEIF "$(CFG)" == "vncconfig - Win32 Debug Unicode" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "vncconfig___Win32_Debug_Unicode" +# PROP BASE Intermediate_Dir "vncconfig___Win32_Debug_Unicode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\Debug_Unicode" +# PROP Intermediate_Dir "Debug_Unicode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".." /D "_DEBUG" /D "_WINDOWS" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".." /D "_WINDOWS" /D "_DEBUG" /D "WIN32" /D "_UNICODE" /D "UNICODE" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib version.lib shell32.lib comctl32.lib ws2_32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 user32.lib gdi32.lib advapi32.lib version.lib shell32.lib comctl32.lib ws2_32.lib ole32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "vncconfig - Win32 Release" +# Name "vncconfig - Win32 Debug" +# Name "vncconfig - Win32 Debug Unicode" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Legacy.cxx +# End Source File +# Begin Source File + +SOURCE=.\vncconfig.cxx +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Authentication.h +# End Source File +# Begin Source File + +SOURCE=.\Connections.h +# End Source File +# Begin Source File + +SOURCE=.\Desktop.h +# End Source File +# Begin Source File + +SOURCE=.\Hooking.h +# End Source File +# Begin Source File + +SOURCE=.\Inputs.h +# End Source File +# Begin Source File + +SOURCE=.\Legacy.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\Sharing.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\connected.ico +# End Source File +# Begin Source File + +SOURCE=.\vncconfig.ico +# End Source File +# Begin Source File + +SOURCE=.\vncconfig.rc +# End Source File +# End Group +# Begin Source File + +SOURCE=.\vncconfig.exe.manifest +# End Source File +# End Target +# End Project diff --git a/vncconfig/vncconfig.exe.manifest b/vncconfig/vncconfig.exe.manifest new file mode 100644 index 00000000..35a4164b --- /dev/null +++ b/vncconfig/vncconfig.exe.manifest @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="4.0.0.26" + processorArchitecture="X86" + name="RealVNC.vncconfig.exe" + type="win32" +/> +<description>.NET control deployment tool</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="X86" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly> diff --git a/vncconfig/vncconfig.ico b/vncconfig/vncconfig.ico Binary files differnew file mode 100644 index 00000000..5b555dd4 --- /dev/null +++ b/vncconfig/vncconfig.ico diff --git a/vncconfig/vncconfig.rc b/vncconfig/vncconfig.rc new file mode 100644 index 00000000..e74c8f13 --- /dev/null +++ b/vncconfig/vncconfig.rc @@ -0,0 +1,479 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON ICON DISCARDABLE "vncconfig.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_AUTHENTICATION DIALOG DISCARDABLE 0, 0, 225, 86 +STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Authentication" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "No Authentication or Encryption",IDC_AUTH_NONE,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,7,10,143,15 + CONTROL "VNC 3.3 Authentication, no Encryption",IDC_AUTH_VNC, + "Button",BS_AUTORADIOBUTTON,7,30,143,15 + PUSHBUTTON "Set Password",IDC_AUTH_VNC_PASSWD,155,30,55,15 + CONTROL "Prompt local user to accept incoming connections", + IDC_QUERY_CONNECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 7,50,211,15 +END + +IDD_CONNECTIONS DIALOG DISCARDABLE 0, 0, 218, 198 +STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Connections" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Accept connections on port:",IDC_STATIC,7,10,138,15, + SS_CENTERIMAGE + LTEXT "Disconnect idle clients after (seconds):",IDC_STATIC,7, + 25,138,15,SS_CENTERIMAGE + EDITTEXT IDC_PORT,150,10,61,15,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT IDC_IDLE_TIMEOUT,150,25,61,15,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Serve Java viewer via HTTP on port:",IDC_HTTP_ENABLE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,40,138,15 + EDITTEXT IDC_HTTP_PORT,150,40,61,15,ES_AUTOHSCROLL | ES_NUMBER + GROUPBOX "Access Control",IDC_STATIC,7,55,204,135 + CONTROL "Only accept connections from the local machine", + IDC_LOCALHOST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15, + 70,190,15 + LISTBOX IDC_HOSTS,15,90,130,95,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + PUSHBUTTON "&Add",IDC_HOST_ADD,150,90,55,15 + PUSHBUTTON "&Remove",IDC_HOST_REMOVE,150,110,55,15 + PUSHBUTTON "Move Up",IDC_HOST_UP,150,130,55,15 + PUSHBUTTON "Move Down",IDC_HOST_DOWN,150,150,55,15 + PUSHBUTTON "&Edit",IDC_HOST_EDIT,150,170,55,15 +END + +IDD_HOOKING DIALOG DISCARDABLE 0, 0, 198, 95 +STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Hooks" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Use VNC hooks to track graphical updates",IDC_USEHOOKS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,10,184,15 + CONTROL "Poll console windows for updates",IDC_POLLCONSOLES, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,25,184,15 + CONTROL "Filter out updates that have no effect (recommended)", + IDC_COMPAREFB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,40, + 184,15 +END + +IDD_AUTH_VNC_PASSWD DIALOG DISCARDABLE 0, 0, 212, 70 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "WinVNC Password" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_PASSWORD1,75,10,130,15,ES_PASSWORD | ES_AUTOHSCROLL + EDITTEXT IDC_PASSWORD2,75,30,130,14,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "New Password:",IDC_STATIC,7,10,63,15 + DEFPUSHBUTTON "OK",IDOK,100,50,50,15 + PUSHBUTTON "Cancel",IDCANCEL,155,50,50,15 + LTEXT "Confirm Password:",IDC_STATIC,7,30,63,14 +END + +IDD_LEGACY DIALOG DISCARDABLE 0, 0, 166, 92 +STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Legacy" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "&Import VNC 3.3 Settings",IDC_LEGACY_IMPORT,7,10,92,20 + CONTROL "Only use protocol version 3.3",IDC_PROTOCOL_3_3,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,35,152,15 +END + +IDD_CONN_HOST DIALOG DISCARDABLE 0, 0, 225, 47 +STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION +CAPTION "Specify Host IP Address Pattern" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,168,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,168,24,50,14 + CONTROL "&Allow",IDC_ALLOW,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,7,7,53,16 + CONTROL "&Deny",IDC_DENY,"Button",BS_AUTORADIOBUTTON,7,23,53,15 + EDITTEXT IDC_HOST_PATTERN,65,7,100,16,ES_AUTOHSCROLL + LTEXT "e.g. 192.168.0.0/255.255.0.0",IDC_STATIC,65,25,100,15 +END + +IDD_SHARING DIALOG DISCARDABLE 0, 0, 186, 95 +STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Sharing" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Always treat new connections as shared", + IDC_SHARE_ALWAYS,"Button",BS_AUTORADIOBUTTON | WS_GROUP, + 7,10,172,15 + CONTROL "Never treat new connections as shared",IDC_SHARE_NEVER, + "Button",BS_AUTORADIOBUTTON,7,25,172,15 + CONTROL "Use client's preferred sharing setting", + IDC_SHARE_CLIENT,"Button",BS_AUTORADIOBUTTON,7,40,172,15 + CONTROL "Non-shared connections replace existing ones", + IDC_DISCONNECT_CLIENTS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,55,172,15 +END + +IDD_INPUTS DIALOG DISCARDABLE 0, 0, 186, 119 +STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Inputs" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Accept keyboard events from clients",IDC_ACCEPT_KEYS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,25,172,15 + CONTROL "Accept pointer events from clients",IDC_ACCEPT_PTR, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,10,172,15 + CONTROL "Accept clipboard updates from clients", + IDC_ACCEPT_CUTTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 7,40,172,15 + CONTROL "Send clipboard updates to clients",IDC_SEND_CUTTEXT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,55,172,15 + CONTROL "Allow input events to affect the screen-saver", + IDC_AFFECT_SCREENSAVER,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,70,172,15 + CONTROL "Disable local inputs while server is in use", + IDC_DISABLE_LOCAL_INPUTS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,95,172,15 +END + +IDD_ABOUT DIALOG DISCARDABLE 0, 0, 249, 92 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "About VNC Config for Windows" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,195,70,47,15 + ICON IDI_ICON,IDC_STATIC,7,7,20,20 + LTEXT ">appname<",IDC_DESCRIPTION,40,7,125,18 + LTEXT ">version<",IDC_VERSION,165,7,77,18 + LTEXT ">buildtime<",IDC_BUILDTIME,40,25,202,15 + LTEXT ">copyright<",IDC_COPYRIGHT,40,40,202,15 + LTEXT "See http://www.realvnc.com for more information on VNC.", + IDC_STATIC,40,55,202,15 +END + +IDD_DESKTOP DIALOG DISCARDABLE 0, 0, 185, 137 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CONTROL | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Desktop" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Do nothing",IDC_DISCONNECT_NONE,"Button", + BS_AUTORADIOBUTTON,15,80,155,15 + CONTROL "Lock workstation",IDC_DISCONNECT_LOCK,"Button", + BS_AUTORADIOBUTTON,15,95,155,15 + CONTROL "Logoff user",IDC_DISCONNECT_LOGOFF,"Button", + BS_AUTORADIOBUTTON,15,110,155,15 + GROUPBOX "When last client disconnects",IDC_STATIC,7,70,171,60 + GROUPBOX "While connected",IDC_STATIC,7,5,171,60 + CONTROL "Remove wallpaper",IDC_REMOVE_WALLPAPER,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,15,155,15 + CONTROL "Remove background pattern",IDC_REMOVE_PATTERN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,30,155,15 + CONTROL "Disable user interface effects",IDC_DISABLE_EFFECTS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,46,155,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_AUTHENTICATION, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 218 + VERTGUIDE, 150 + VERTGUIDE, 155 + VERTGUIDE, 210 + TOPMARGIN, 7 + BOTTOMMARGIN, 79 + HORZGUIDE, 10 + HORZGUIDE, 25 + HORZGUIDE, 30 + HORZGUIDE, 45 + HORZGUIDE, 50 + HORZGUIDE, 65 + END + + IDD_CONNECTIONS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 211 + VERTGUIDE, 15 + VERTGUIDE, 145 + VERTGUIDE, 150 + VERTGUIDE, 205 + TOPMARGIN, 7 + BOTTOMMARGIN, 191 + HORZGUIDE, 10 + HORZGUIDE, 25 + HORZGUIDE, 40 + HORZGUIDE, 55 + HORZGUIDE, 70 + HORZGUIDE, 85 + HORZGUIDE, 90 + HORZGUIDE, 105 + HORZGUIDE, 110 + HORZGUIDE, 125 + HORZGUIDE, 130 + HORZGUIDE, 145 + HORZGUIDE, 150 + HORZGUIDE, 165 + HORZGUIDE, 170 + HORZGUIDE, 185 + HORZGUIDE, 190 + END + + IDD_HOOKING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 191 + TOPMARGIN, 7 + BOTTOMMARGIN, 88 + HORZGUIDE, 10 + HORZGUIDE, 25 + HORZGUIDE, 40 + HORZGUIDE, 55 + END + + IDD_AUTH_VNC_PASSWD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 205 + VERTGUIDE, 70 + VERTGUIDE, 75 + VERTGUIDE, 100 + VERTGUIDE, 150 + VERTGUIDE, 155 + VERTGUIDE, 205 + TOPMARGIN, 7 + BOTTOMMARGIN, 65 + HORZGUIDE, 10 + HORZGUIDE, 25 + HORZGUIDE, 30 + HORZGUIDE, 44 + HORZGUIDE, 50 + HORZGUIDE, 65 + END + + IDD_LEGACY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 159 + TOPMARGIN, 7 + BOTTOMMARGIN, 85 + HORZGUIDE, 10 + HORZGUIDE, 30 + HORZGUIDE, 35 + HORZGUIDE, 50 + END + + IDD_CONN_HOST, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 218 + VERTGUIDE, 60 + VERTGUIDE, 65 + VERTGUIDE, 165 + TOPMARGIN, 7 + BOTTOMMARGIN, 40 + END + + IDD_SHARING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 88 + HORZGUIDE, 10 + HORZGUIDE, 25 + HORZGUIDE, 40 + HORZGUIDE, 55 + HORZGUIDE, 70 + END + + IDD_INPUTS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 112 + HORZGUIDE, 10 + HORZGUIDE, 25 + HORZGUIDE, 40 + HORZGUIDE, 55 + HORZGUIDE, 70 + HORZGUIDE, 85 + HORZGUIDE, 95 + HORZGUIDE, 110 + END + + IDD_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 242 + VERTGUIDE, 40 + VERTGUIDE, 165 + VERTGUIDE, 195 + TOPMARGIN, 7 + BOTTOMMARGIN, 85 + HORZGUIDE, 7 + HORZGUIDE, 25 + HORZGUIDE, 40 + HORZGUIDE, 55 + HORZGUIDE, 70 + END + + IDD_DESKTOP, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 178 + VERTGUIDE, 15 + VERTGUIDE, 170 + TOPMARGIN, 5 + BOTTOMMARGIN, 130 + HORZGUIDE, 15 + HORZGUIDE, 30 + HORZGUIDE, 45 + HORZGUIDE, 60 + HORZGUIDE, 65 + HORZGUIDE, 70 + HORZGUIDE, 80 + HORZGUIDE, 95 + HORZGUIDE, 110 + HORZGUIDE, 125 + END +END +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 4,0,0,26 + PRODUCTVERSION 4,0,0,26 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "RealVNC Ltd.\0" + VALUE "FileDescription", "VNC Server Configuration Applet for Win32\0" + VALUE "FileVersion", "4.0\0" + VALUE "InternalName", "VNC Config 4.0\0" + VALUE "LegalCopyright", "Copyright © RealVNC Ltd. 2002-2004\0" + VALUE "LegalTrademarks", "RealVNC\0" + VALUE "OriginalFilename", "vncconfig.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "VNC Config 4.0\0" + VALUE "ProductVersion", "4.0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// 24 +// + +IDR_MANIFEST 24 DISCARDABLE "vncconfig.exe.manifest" +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + |