From: Constantin Kaplinsky Date: Thu, 11 May 2006 10:30:11 +0000 (+0000) Subject: WinVNC merged with VNC 4.1.1 code. X-Git-Tag: v0.0.90~384^2~312^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9eede292ec2021bdf2f8fc0990cee422547ada08;p=tigervnc.git WinVNC merged with VNC 4.1.1 code. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/merge-with-vnc-4.1.1@550 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/winvnc/AddNewClientDialog.h b/winvnc/AddNewClientDialog.h index d8e0af36..9bf51355 100644 --- a/winvnc/AddNewClientDialog.h +++ b/winvnc/AddNewClientDialog.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 diff --git a/winvnc/JavaViewer.cxx b/winvnc/JavaViewer.cxx index fecbcee0..15c05c46 100644 --- a/winvnc/JavaViewer.cxx +++ b/winvnc/JavaViewer.cxx @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 @@ -16,7 +16,6 @@ * USA. */ -#define WIN32_LEAN_AND_MEAN #include #include #include @@ -39,7 +38,11 @@ JavaViewerServer::JavaViewerServer(rfb::VNCServerST* svr) : server(svr) { JavaViewerServer::~JavaViewerServer() { } -rdr::InStream* JavaViewerServer::getFile(const char* name, const char** contentType) { +rdr::InStream* JavaViewerServer::getFile(const char* name, + const char** contentType, + int* contentLength, + time_t* lastModified) +{ if (strcmp(name, "/") == 0) name = "/index.vnc"; diff --git a/winvnc/JavaViewer.h b/winvnc/JavaViewer.h index 20af786b..ecda4d3e 100644 --- a/winvnc/JavaViewer.h +++ b/winvnc/JavaViewer.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 @@ -35,7 +35,8 @@ namespace winvnc { JavaViewerServer(rfb::VNCServerST* desktop); virtual ~JavaViewerServer(); - virtual rdr::InStream* getFile(const char* name, const char** contentType); + virtual rdr::InStream* getFile(const char* name, const char** contentType, + int* contentLength, time_t* lastModified); // rdr::Substitutor callback virtual char* substitute(const char* varName); diff --git a/winvnc/ManagedListener.cxx b/winvnc/ManagedListener.cxx new file mode 100644 index 00000000..9bf1b9a1 --- /dev/null +++ b/winvnc/ManagedListener.cxx @@ -0,0 +1,94 @@ +/* Copyright (C) 2005 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 +#include + +using namespace winvnc; +using namespace rfb; +using namespace win32; + +static LogWriter vlog("ManagedListener"); + + +ManagedListener::ManagedListener(SocketManager* mgr) +: sock(0), filter(0), manager(mgr), addrChangeNotifier(0), server(0), port(0), localOnly(false) { +} + +ManagedListener::~ManagedListener() { + if (sock) + manager->remListener(sock); + delete filter; +} + + +void ManagedListener::setServer(network::SocketServer* svr) { + if (svr == server) + return; + vlog.info("set server to %p", svr); + server = svr; + refresh(); +} + +void ManagedListener::setPort(int port_, bool localOnly_) { + if ((port_ == port) && (localOnly == localOnly_)) + return; + vlog.info("set port to %d", port_); + port = port_; + localOnly = localOnly_; + refresh(); +} + +void ManagedListener::setFilter(const char* filterStr) { + vlog.info("set filter to %s", filterStr); + delete filter; + filter = new network::TcpFilter(filterStr); + if (sock && !localOnly) + sock->setFilter(filter); +} + +void ManagedListener::setAddressChangeNotifier(SocketManager::AddressChangeNotifier* acn) { + if (acn == addrChangeNotifier) + return; + addrChangeNotifier = acn; + refresh(); +} + + +void ManagedListener::refresh() { + if (sock) + manager->remListener(sock); + sock = 0; + if (!server) + return; + try { + if (port) + sock = new network::TcpListener(port, localOnly); + } catch (rdr::Exception& e) { + vlog.error(e.str()); + } + if (sock) { + if (!localOnly) + sock->setFilter(filter); + try { + manager->addListener(sock, server, addrChangeNotifier); + } catch (...) { + sock = 0; + throw; + } + } +} diff --git a/winvnc/ManagedListener.h b/winvnc/ManagedListener.h new file mode 100644 index 00000000..e83aa0b6 --- /dev/null +++ b/winvnc/ManagedListener.h @@ -0,0 +1,57 @@ +/* Copyright (C) 2002-2005 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 __VNCSERVER_MANAGED_LISTENER_H__ +#define __VNCSERVER_MANAGED_LISTENER_H__ + +#include +#include +#include + +namespace winvnc { + + // -=- ManagedListener + // Wrapper class which simplifies the management of a listening socket + // on a specified port, attached to a SocketManager and SocketServer. + // Reopens sockets & reconfigures filters & callbacks as appropriate. + // Handles addition/removal of Listeners from SocketManager internally. + + class ManagedListener { + public: + ManagedListener(rfb::win32::SocketManager* mgr); + ~ManagedListener(); + + void setServer(network::SocketServer* svr); + void setPort(int port, bool localOnly=false); + void setFilter(const char* filter); + void setAddressChangeNotifier(rfb::win32::SocketManager::AddressChangeNotifier* acn); + + network::TcpListener* sock; + protected: + void refresh(); + network::TcpFilter* filter; + rfb::win32::SocketManager* manager; + rfb::win32::SocketManager::AddressChangeNotifier* addrChangeNotifier; + network::SocketServer* server; + int port; + bool localOnly; + }; + +}; + +#endif diff --git a/winvnc/QueryConnectDialog.cxx b/winvnc/QueryConnectDialog.cxx index 52d7249d..dc50eab3 100644 --- a/winvnc/QueryConnectDialog.cxx +++ b/winvnc/QueryConnectDialog.cxx @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 diff --git a/winvnc/QueryConnectDialog.h b/winvnc/QueryConnectDialog.h index 30dd2705..b28de198 100644 --- a/winvnc/QueryConnectDialog.h +++ b/winvnc/QueryConnectDialog.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 diff --git a/winvnc/STrayIcon.cxx b/winvnc/STrayIcon.cxx index 229f1ce5..0b10fa5b 100644 --- a/winvnc/STrayIcon.cxx +++ b/winvnc/STrayIcon.cxx @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 @@ -19,6 +19,7 @@ // -=- WinVNC Version 4.0 Tray Icon implementation #include +#include #include #include @@ -26,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -38,6 +39,7 @@ using namespace winvnc; static LogWriter vlog("STrayIcon"); BoolParameter STrayIconThread::disableOptions("DisableOptions", "Disable the Options entry in the VNC Server tray menu.", false); +BoolParameter STrayIconThread::disableClose("DisableClose", "Disable the Close entry in the VNC Server tray menu.", false); // @@ -62,7 +64,7 @@ class winvnc::STrayIcon : public TrayIcon { public: STrayIcon(STrayIconThread& t) : thread(t), vncConfig(_T("vncconfig.exe"), isServiceProcess() ? _T("-noconsole -service") : _T("-noconsole")), - vncConnect(_T("winvnc4.exe"), _T("-connect")) { + vncConnect(_T("winvnc4.exe"), _T("-noconsole -connect")) { // *** SetWindowText(getHandle(), _T("winvnc::IPC_Interface")); @@ -79,8 +81,9 @@ public: case WM_USER: { - bool userKnown = CurrentUserToken().isValid(); + bool userKnown = CurrentUserToken().canImpersonate(); bool allowOptions = !STrayIconThread::disableOptions && userKnown; + bool allowClose = !STrayIconThread::disableClose && userKnown; switch (lParam) { case WM_LBUTTONDBLCLK: @@ -97,7 +100,7 @@ public: // Enable/disable options as required EnableMenuItem(trayMenu, ID_OPTIONS, (!allowOptions ? MF_GRAYED : MF_ENABLED) | MF_BYCOMMAND); EnableMenuItem(trayMenu, ID_CONNECT, (!userKnown ? MF_GRAYED : MF_ENABLED) | MF_BYCOMMAND); - EnableMenuItem(trayMenu, ID_CLOSE, (isServiceProcess() ? MF_GRAYED : MF_ENABLED) | MF_BYCOMMAND); + EnableMenuItem(trayMenu, ID_CLOSE, (!allowClose ? MF_GRAYED : MF_ENABLED) | MF_BYCOMMAND); thread.server.getClientsInfo(&LCInfo); CheckMenuItem(trayMenu, ID_DISABLE_NEW_CLIENTS, (LCInfo.getDisable() ? MF_CHECKED : MF_UNCHECKED) | MF_BYCOMMAND); @@ -134,8 +137,8 @@ public: case ID_OPTIONS: { CurrentUserToken token; - if (token.isValid()) - vncConfig.start(isServiceProcess() ? (HANDLE)token : 0); + if (token.canImpersonate()) + vncConfig.start(isServiceProcess() ? (HANDLE)token : INVALID_HANDLE_VALUE); else vlog.error("Options: unknown current user"); } @@ -143,8 +146,8 @@ public: case ID_CONNECT: { CurrentUserToken token; - if (token.isValid()) - vncConnect.start(isServiceProcess() ? (HANDLE)token : 0); + if (token.canImpersonate()) + vncConnect.start(isServiceProcess() ? (HANDLE)token : INVALID_HANDLE_VALUE); else vlog.error("Options: unknown current user"); } @@ -153,8 +156,19 @@ public: thread.server.disconnectClients("tray menu disconnect"); break; case ID_CLOSE: - if (!isServiceProcess()) - thread.server.stop(); + if (MsgBox(0, _T("Are you sure you want to close the server?"), + MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) == IDYES) { + if (isServiceProcess()) { + ImpersonateCurrentUser icu; + try { + rfb::win32::stopService(VNCServerService::Name); + } catch (rdr::Exception& e) { + MsgBox(0, TStr(e.str()), MB_ICONERROR | MB_OK); + } + } else { + thread.server.stop(); + } + } break; case ID_ABOUT: AboutDialog::instance.showDialog(); @@ -172,12 +186,10 @@ public: CharArray viewer = new char[command->cbData + 1]; memcpy(viewer.buf, command->lpData, command->cbData); viewer.buf[command->cbData] = 0; - thread.server.addNewClient(viewer.buf); + return thread.server.addNewClient(viewer.buf) ? 1 : 0; } - break; case 2: - thread.server.disconnectClients("IPC disconnect"); - break; + return thread.server.disconnectClients("IPC disconnect") ? 1 : 0; case 3: thread.server.setClientsStatus((rfb::ListConnInfo *)command->cbData); case 4: @@ -231,7 +243,7 @@ protected: STrayIconThread::STrayIconThread(VNCServerWin32& sm, UINT inactiveIcon_, UINT activeIcon_, UINT dis_inactiveIcon_, UINT dis_activeIcon_, UINT menu_) -: server(sm), inactiveIcon(inactiveIcon_), activeIcon(activeIcon_), +: Thread("TrayIcon"), server(sm), inactiveIcon(inactiveIcon_), activeIcon(activeIcon_), dis_inactiveIcon(dis_inactiveIcon_), dis_activeIcon(dis_activeIcon_),menu(menu_), windowHandle(0), runTrayIcon(true) { start(); diff --git a/winvnc/STrayIcon.h b/winvnc/STrayIcon.h index ef32eba6..309d3f4a 100644 --- a/winvnc/STrayIcon.h +++ b/winvnc/STrayIcon.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 @@ -40,6 +40,7 @@ namespace winvnc { void setToolTip(const TCHAR* text); static rfb::BoolParameter disableOptions; + static rfb::BoolParameter disableClose; friend class STrayIcon; protected: @@ -57,4 +58,4 @@ namespace winvnc { }; -#endif \ No newline at end of file +#endif diff --git a/winvnc/VNCServerService.cxx b/winvnc/VNCServerService.cxx index c967a5a5..2ef2ee08 100644 --- a/winvnc/VNCServerService.cxx +++ b/winvnc/VNCServerService.cxx @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 diff --git a/winvnc/VNCServerService.h b/winvnc/VNCServerService.h index 378ad0c5..c7a76cce 100644 --- a/winvnc/VNCServerService.h +++ b/winvnc/VNCServerService.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 @@ -31,9 +31,6 @@ namespace winvnc { DWORD serviceMain(int argc, TCHAR* argv[]); void stop(); - void osShuttingDown() {} - void readParams() {} - static const TCHAR* Name; protected: VNCServerWin32& server; diff --git a/winvnc/VNCServerWin32.cxx b/winvnc/VNCServerWin32.cxx index 67b3ec51..8d681c22 100644 --- a/winvnc/VNCServerWin32.cxx +++ b/winvnc/VNCServerWin32.cxx @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 @@ -21,8 +21,8 @@ #include #include #include - -#include +#include +#include #include #include #include @@ -38,90 +38,28 @@ static LogWriter vlog("VNCServerWin32"); const TCHAR* winvnc::VNCServerWin32::RegConfigPath = _T("Software\\TightVNC\\WinVNC4"); -const UINT VNCM_REG_CHANGED = WM_USER; -const UINT VNCM_COMMAND = WM_USER + 1; - static IntParameter http_port("HTTPPortNumber", "TCP/IP port on which the server will serve the Java applet VNC Viewer ", 5800); static IntParameter port_number("PortNumber", "TCP/IP port on which the server will accept connections", 5900); static StringParameter hosts("Hosts", - "Filter describing which hosts are allowed access to this server", "+"); -static VncAuthPasswdConfigParameter vncAuthPasswd; + "Filter describing which hosts are allowed access to this server", "+0.0.0.0/0.0.0.0"); static BoolParameter localHost("LocalHost", "Only accept connections from via the local loop-back network interface", false); - - -// -=- ManagedListener -// Wrapper class which simplifies the management of a listening socket -// on a specified port, attached to a SocketManager and SocketServer. -// Ensures that socket and filter are deleted and updated appropriately. - -class ManagedListener { -public: - ManagedListener(win32::SocketManager* mgr, SocketServer* svr) - : sock(0), filter(0), port(0), manager(mgr), - server(svr), localOnly(0) {} - ~ManagedListener() {setPort(0);} - void setPort(int port, bool localOnly=false); - void setFilter(const char* filter); - TcpListener* sock; -protected: - TcpFilter* filter; - win32::SocketManager* manager; - SocketServer* server; - int port; - bool localOnly; -}; - -// - If the port number/localHost setting has changed then tell the -// SocketManager to shutdown and delete it. Also remove & -// delete the filter. Then try to open a socket on the new port. -void ManagedListener::setPort(int newPort, bool newLocalOnly) { - if ((port == newPort) && (localOnly == newLocalOnly) && sock) return; - if (sock) { - vlog.info("Closed TcpListener on port %d", port); - sock->setFilter(0); - delete filter; - manager->remListener(sock); - sock = 0; - filter = 0; - } - port = newPort; - localOnly = newLocalOnly; - if (port != 0) { - try { - sock = new TcpListener(port, localOnly); - vlog.info("Created TcpListener on port %d%s", port, - localOnly ? "(localhost)" : "(any)"); - } catch (rdr::Exception& e) { - vlog.error("TcpListener on port %d failed (%s)", port, e.str()); - } - } - if (sock) - manager->addListener(sock, server); -} - -void ManagedListener::setFilter(const char* newFilter) { - if (!sock) return; - vlog.info("Updating TcpListener filter"); - sock->setFilter(0); - delete filter; - filter = new TcpFilter(newFilter); - sock->setFilter(filter); -} +static BoolParameter queryOnlyIfLoggedOn("QueryOnlyIfLoggedOn", + "Only prompt for a local user to accept incoming connections if there is a user logged on", false); VNCServerWin32::VNCServerWin32() - : vncServer(CStr(ComputerName().buf), &desktop), - httpServer(0), runServer(false), - isDesktopStarted(false), - command(NoCommand), commandSig(commandLock), - queryConnectDialog(0) { - // Create the Java-viewer HTTP server - httpServer = new JavaViewerServer(&vncServer); - + : command(NoCommand), commandSig(commandLock), + commandEvent(CreateEvent(0, TRUE, FALSE, 0)), + vncServer(CStr(ComputerName().buf), &desktop), + hostThread(0), runServer(false), isDesktopStarted(false), + httpServer(&vncServer), config(&sockMgr), trayIcon(0), + rfbSock(&sockMgr), httpSock(&sockMgr), + queryConnectDialog(0) +{ // Initialise the desktop desktop.setStatusLocation(&isDesktopStarted); @@ -130,14 +68,78 @@ VNCServerWin32::VNCServerWin32() // Register the desktop's event to be handled sockMgr.addEvent(desktop.getUpdateEvent(), &desktop); + + // Register the queued command event to be handled + sockMgr.addEvent(commandEvent, this); } VNCServerWin32::~VNCServerWin32() { + delete trayIcon; + // Stop the SDisplay from updating our state desktop.setStatusLocation(0); - // Destroy the HTTP server - delete httpServer; + // Join the Accept/Reject dialog thread + if (queryConnectDialog) + delete queryConnectDialog->join(); +} + + +void VNCServerWin32::processAddressChange(network::SocketListener* sock_) { + if (!trayIcon || (sock_ != rfbSock.sock)) + return; + + // Tool-tip prefix depends on server mode + const TCHAR* prefix = _T("VNC Server (User):"); + if (isServiceProcess()) + prefix = _T("VNC Server (Service):"); + + // Fetch the list of addresses + std::list addrs; + if (rfbSock.sock) + rfbSock.sock->getMyAddresses(&addrs); + else + addrs.push_front(strDup("Not accepting connections")); + + // Allocate space for the new tip + std::list::iterator i, next_i; + int length = _tcslen(prefix)+1; + for (i=addrs.begin(); i!= addrs.end(); i++) + length += strlen(*i) + 1; + + // Build the new tip + TCharArray toolTip(length); + _tcscpy(toolTip.buf, prefix); + for (i=addrs.begin(); i!= addrs.end(); i=next_i) { + next_i = i; next_i ++; + TCharArray addr = *i; // Assumes ownership of string + _tcscat(toolTip.buf, addr.buf); + if (next_i != addrs.end()) + _tcscat(toolTip.buf, _T(",")); + } + + // Pass the new tip to the tray icon + vlog.info("Refreshing tray icon"); + trayIcon->setToolTip(toolTip.buf); +} + +void VNCServerWin32::regConfigChanged() { + // -=- Make sure we're listening on the right ports. + rfbSock.setServer(&vncServer); + rfbSock.setPort(port_number, localHost); + httpSock.setServer(&httpServer); + httpSock.setPort(http_port, localHost); + + // -=- Update the Java viewer's web page port number. + httpServer.setRFBport(rfbSock.sock ? port_number : 0); + + // -=- Update the TCP address filter for both ports, if open. + CharArray pattern(hosts.getData()); + rfbSock.setFilter(pattern.buf); + httpSock.setFilter(pattern.buf); + + // -=- Update the tray icon tooltip text with IP addresses + processAddressChange(rfbSock.sock); } @@ -147,85 +149,37 @@ int VNCServerWin32::run() { runServer = true; } + // - Create the tray icon (if possible) + trayIcon = new STrayIconThread(*this, IDI_ICON, IDI_CONNECTED, + IDI_ICON_DISABLE, IDI_CONNECTED_DISABLE, + IDR_TRAY); + // - Register for notification of configuration changes + config.setCallback(this); if (isServiceProcess()) config.setKey(HKEY_LOCAL_MACHINE, RegConfigPath); else config.setKey(HKEY_CURRENT_USER, RegConfigPath); - config.setNotifyThread(Thread::self(), VNCM_REG_CHANGED); - // - Create the tray icon if possible - STrayIconThread trayIcon(*this, IDI_ICON, IDI_CONNECTED, IDI_ICON_DISABLE, - IDI_CONNECTED_DISABLE, IDR_TRAY); + // - Set the address-changed handler for the RFB socket + rfbSock.setAddressChangeNotifier(this); DWORD result = 0; try { - // - Create some managed listening sockets - ManagedListener rfb(&sockMgr, &vncServer); - ManagedListener http(&sockMgr, httpServer); + vlog.debug("Entering message loop"); - // - Continue to operate until WM_QUIT is processed + // - Run the server until we're told to quit MSG msg; - do { - // -=- Make sure we're listening on the right ports. - rfb.setPort(port_number, localHost); - http.setPort(http_port, localHost); - - // -=- Update the Java viewer's web page port number. - httpServer->setRFBport(rfb.sock ? port_number : 0); - - // -=- Update the TCP address filter for both ports, if open. - CharArray pattern; - pattern.buf = hosts.getData(); - if (!localHost) { - rfb.setFilter(pattern.buf); - http.setFilter(pattern.buf); - } - - // - If there is a listening port then add the address to the - // tray icon's tool-tip text. - { - const TCHAR* prefix = isServiceProcess() ? - _T("VNC Server (Service):") : _T("VNC Server (User):"); - - std::list addrs; - if (rfb.sock) - rfb.sock->getMyAddresses(&addrs); - else - addrs.push_front(strDup("Not accepting connections")); - - std::list::iterator i, next_i; - int length = _tcslen(prefix)+1; - for (i=addrs.begin(); i!= addrs.end(); i++) - length += strlen(*i) + 1; - - TCharArray toolTip(length); - _tcscpy(toolTip.buf, prefix); - for (i=addrs.begin(); i!= addrs.end(); i=next_i) { - next_i = i; next_i ++; - TCharArray addr = *i; // Assumes ownership of string - _tcscat(toolTip.buf, addr.buf); - if (next_i != addrs.end()) - _tcscat(toolTip.buf, _T(",")); - } - trayIcon.setToolTip(toolTip.buf); - } - - vlog.debug("Entering message loop"); - - // - Run the server until the registry changes, or we're told to quit - while (sockMgr.getMessage(&msg, NULL, 0, 0)) { - if (msg.hwnd == 0) { - if (msg.message == VNCM_REG_CHANGED) - break; - if (msg.message == VNCM_COMMAND) - doCommand(); - } - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - } while ((msg.message != WM_QUIT) || runServer); + int result = 0; + while (runServer) { + result = sockMgr.getMessage(&msg, NULL, 0, 0); + if (result < 0) + throw rdr::SystemException("getMessage", GetLastError()); + if (!isServiceProcess() && (result == 0)) + break; + TranslateMessage(&msg); + DispatchMessage(&msg); + } vlog.debug("Server exited cleanly"); } catch (rdr::SystemException &s) { @@ -246,7 +200,8 @@ int VNCServerWin32::run() { void VNCServerWin32::stop() { Lock l(runLock); runServer = false; - PostThreadMessage(hostThread->getThreadId(), WM_QUIT, 0, 0); + if (hostThread) + PostThreadMessage(hostThread->getThreadId(), WM_QUIT, 0, 0); } @@ -283,6 +238,8 @@ VNCServerST::queryResult VNCServerWin32::queryConnection(network::Socket* sock, const char* userName, char** reason) { + if (queryOnlyIfLoggedOn && CurrentUserToken().noUserLoggedOn()) + return VNCServerST::ACCEPT; if (queryConnectDialog) { *reason = rfb::strDup("Another connection is currently being queried."); return VNCServerST::REJECT; @@ -293,51 +250,49 @@ VNCServerST::queryResult VNCServerWin32::queryConnection(network::Socket* sock, } void VNCServerWin32::queryConnectionComplete() { - Thread* qcd = queryConnectDialog; - queueCommand(QueryConnectionComplete, 0, 0); - delete qcd->join(); + queueCommand(QueryConnectionComplete, 0, 0, false); } -bool VNCServerWin32::queueCommand(Command cmd, const void* data, int len) { +bool VNCServerWin32::queueCommand(Command cmd, const void* data, int len, bool wait) { Lock l(commandLock); - while (command != NoCommand) commandSig.wait(); + while (command != NoCommand) + commandSig.wait(); command = cmd; commandData = data; commandDataLen = len; - if (PostThreadMessage(hostThread->getThreadId(), VNCM_COMMAND, 0, 0)) - while (command != NoCommand) commandSig.wait(); - else - return false; + SetEvent(commandEvent); + if (wait) { + while (command != NoCommand) + commandSig.wait(); + commandSig.signal(); + } return true; } -void VNCServerWin32::doCommand() { - Lock l(commandLock); - if (command == NoCommand) return; +void VNCServerWin32::processEvent(HANDLE event_) { + ResetEvent(event_); - // Perform the required command - switch (command) { + if (event_ == commandEvent.h) { + // If there is no command queued then return immediately + { + Lock l(commandLock); + if (command == NoCommand) + return; + } - case DisconnectClients: - // Disconnect all currently active VNC Viewers - vncServer.closeClients((const char*)commandData); - break; + // Perform the required command + switch (command) { - case AddClient: - // Make a reverse connection to a VNC Viewer - vncServer.addClient((network::Socket*)commandData, true); - sockMgr.addSocket((network::Socket*)commandData, &vncServer); - break; + case DisconnectClients: + // Disconnect all currently active VNC Viewers + vncServer.closeClients((const char*)commandData); + break; - case QueryConnectionComplete: - // The Accept/Reject dialog has completed - // Get the result, then clean it up - vncServer.approveConnection(queryConnectDialog->getSock(), - queryConnectDialog->isAccepted(), - "Connection rejected by user"); - queryConnectDialog = 0; - break; + case AddClient: + // Make a reverse connection to a VNC Viewer + sockMgr.addSocket((network::Socket*)commandData, &vncServer); + break; case GetClientsInfo: vncServer.getConnInfo((ListConnInfo*)commandData); break; @@ -345,11 +300,26 @@ void VNCServerWin32::doCommand() { vncServer.setConnStatus((ListConnInfo*)commandData); break; - default: - vlog.error("unknown command %d queued", command); - }; - - // Clear the command and signal completion - command = NoCommand; - commandSig.signal(); + case QueryConnectionComplete: + // The Accept/Reject dialog has completed + // Get the result, then clean it up + vncServer.approveConnection(queryConnectDialog->getSock(), + queryConnectDialog->isAccepted(), + "Connection rejected by user"); + delete queryConnectDialog->join(); + queryConnectDialog = 0; + break; + + default: + vlog.error("unknown command %d queued", command); + }; + + // Clear the command and signal completion + { + Lock l(commandLock); + command = NoCommand; + commandSig.signal(); + } + } } + diff --git a/winvnc/VNCServerWin32.h b/winvnc/VNCServerWin32.h index 0af5fd5a..f05f2c70 100644 --- a/winvnc/VNCServerWin32.h +++ b/winvnc/VNCServerWin32.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 @@ -28,11 +28,16 @@ #include #include #include -//#include +#include namespace winvnc { - class VNCServerWin32 : rfb::VNCServerST::QueryConnectionHandler { + class STrayIconThread; + + class VNCServerWin32 : rfb::VNCServerST::QueryConnectionHandler, + rfb::win32::SocketManager::AddressChangeNotifier, + rfb::win32::RegConfig::Callback, + rfb::win32::EventHandler { public: VNCServerWin32(); virtual ~VNCServerWin32(); @@ -60,31 +65,43 @@ namespace winvnc { // CALLED FROM AcceptConnectDialog THREAD void queryConnectionComplete(); - // Overridden VNCServerST::QueryConnectionHandler callback, - // used to prompt user to accept or reject a connection. + // Where to read the configuration settings from + static const TCHAR* RegConfigPath; + + bool getClientsInfo(rfb::ListConnInfo* LCInfo); + + bool setClientsStatus(rfb::ListConnInfo* LCInfo); + + protected: + // VNCServerST::QueryConnectionHandler interface + // Callback used to prompt user to accept or reject a connection. // CALLBACK IN VNCServerST "HOST" THREAD virtual rfb::VNCServerST::queryResult queryConnection(network::Socket* sock, const char* userName, char** reason); - bool getClientsInfo(rfb::ListConnInfo* LCInfo); + // SocketManager::AddressChangeNotifier interface + // Used to keep tray icon up to date + virtual void processAddressChange(network::SocketListener* sl); - bool setClientsStatus(rfb::ListConnInfo* LCInfo); + // RegConfig::Callback interface + // Called via the EventManager whenver RegConfig sees the registry change + virtual void regConfigChanged(); - // Where to read the configuration settings from - static const TCHAR* RegConfigPath; + // EventHandler interface + // Used to perform queued commands + virtual void processEvent(HANDLE event); protected: - // Perform a particular internal function in the server thread typedef enum {NoCommand, DisconnectClients, AddClient, QueryConnectionComplete, SetClientsStatus, GetClientsInfo} Command; - bool queueCommand(Command cmd, const void* data, int len); - void doCommand(); + bool queueCommand(Command cmd, const void* data, int len, bool wait=true); Command command; const void* commandData; int commandDataLen; rfb::Mutex commandLock; rfb::Condition commandSig; + rfb::win32::Handle commandEvent; // VNCServerWin32 Server-internal state rfb::win32::SDisplay desktop; @@ -93,9 +110,16 @@ namespace winvnc { rfb::Thread* hostThread; bool runServer; bool isDesktopStarted; - JavaViewerServer* httpServer; - rfb::win32::RegistryReader config; + JavaViewerServer httpServer; rfb::win32::SocketManager sockMgr; + rfb::win32::RegConfig config; + + ManagedListener rfbSock; + ManagedListener httpSock; + STrayIconThread* trayIcon; + + //rfb::SSecurityFactoryStandard securityFactory; + QueryConnectDialog* queryConnectDialog; }; diff --git a/winvnc/buildTime.cxx b/winvnc/buildTime.cxx index bab2e137..9f37b387 100644 --- a/winvnc/buildTime.cxx +++ b/winvnc/buildTime.cxx @@ -1 +1,18 @@ -const char* buildTime = "Built on " __DATE__ " at " __TIME__; \ No newline at end of file +/* Copyright (C) 2005 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. + */ +const char* buildTime = "Built on " __DATE__ " at " __TIME__; diff --git a/winvnc/msvcwarning.h b/winvnc/msvcwarning.h deleted file mode 100644 index 53a0678d..00000000 --- a/winvnc/msvcwarning.h +++ /dev/null @@ -1,19 +0,0 @@ -/* 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. - */ -#pragma warning( disable : 4800 ) // forcing bool 'true' or 'false' -#pragma warning( disable : 4786 ) // debug identifier truncated diff --git a/winvnc/resource.h b/winvnc/resource.h index 1cb074b9..68316be9 100644 --- a/winvnc/resource.h +++ b/winvnc/resource.h @@ -9,11 +9,12 @@ #define IDD_ABOUT 104 #define IDI_CONNECTED 105 #define IDR_VNCVIEWER_JAR 106 -#define IDD_CONTROL_PANEL 106 #define IDD_QUERY_CONNECT 107 #define IDD_ADD_NEW_CLIENT 108 -#define IDI_ICON_DISABLE 109 -#define IDI_CONNECTED_DISABLE 110 +#define IDB_BITMAP 109 +#define IDD_CONTROL_PANEL 110 +#define IDI_ICON_DISABLE 111 +#define IDI_CONNECTED_DISABLE 112 #define IDC_DESCRIPTION 1000 #define IDC_BUILDTIME 1001 #define IDC_VERSION 1002 @@ -45,9 +46,9 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 111 +#define _APS_NEXT_RESOURCE_VALUE 113 #define _APS_NEXT_COMMAND_VALUE 40008 -#define _APS_NEXT_CONTROL_VALUE 1024 +#define _APS_NEXT_CONTROL_VALUE 1023 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/winvnc/winvnc.bmp b/winvnc/winvnc.bmp new file mode 100644 index 00000000..90c02f89 Binary files /dev/null and b/winvnc/winvnc.bmp differ diff --git a/winvnc/winvnc.cxx b/winvnc/winvnc.cxx index 5ba6ebc5..2d01f893 100644 --- a/winvnc/winvnc.cxx +++ b/winvnc/winvnc.cxx @@ -1,5 +1,5 @@ -/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved. - * +/* Copyright (C) 2002-2005 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 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include using namespace winvnc; @@ -53,8 +53,7 @@ static bool close_console = false; // Read in the command-line parameters and interpret them. // -void -programInfo() { +static void programInfo() { win32::FileVersionInfo inf; _tprintf(_T("%s - %s, Version %s\n"), inf.getVerString(_T("ProductName")), @@ -64,8 +63,7 @@ programInfo() { _tprintf(_T("%s\n\n"), inf.getVerString(_T("LegalCopyright"))); } -void -programUsage() { +static void programUsage() { printf("Command-line options:\n"); printf(" -connect [] - Connect an existing WinVNC server to a listening viewer.\n"); printf(" -disconnect - Disconnect all clients from an existing WinVNC server.\n"); @@ -86,8 +84,22 @@ programUsage() { Configuration::listParams(); } -void -processParams(int argc, const char* argv[]) { +static void MsgBoxOrLog(const char* msg, bool isError=false) { + if (close_console) { + MsgBox(0, TStr(msg), (isError ? MB_ICONERROR : MB_ICONINFORMATION) | MB_OK); + } else { + if (isError) { + try { + vlog.error(msg); + return; + } catch (...) { + } + } + fprintf(stderr, "%s\n", msg); + } +} + +static void processParams(int argc, const char* argv[]) { for (int i=1; iappname<",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.tightvnc.com for more information on TightVNC.", - IDC_STATIC,40,55,202,15 + CONTROL 109,IDC_STATIC,"Static",SS_BITMAP,5,10,33,31 + LTEXT ">appname<",IDC_DESCRIPTION,45,10,125,15 + LTEXT ">version<",IDC_VERSION,170,10,72,15 + LTEXT ">buildtime<",IDC_BUILDTIME,45,25,202,15 + LTEXT ">copyright<",IDC_COPYRIGHT,45,40,202,15 + LTEXT "See http://www.tightvnc.com for more information on VNC.", + IDC_STATIC,45,55,202,15 END IDD_QUERY_CONNECT DIALOG DISCARDABLE 0, 0, 164, 93 @@ -142,21 +165,62 @@ BEGIN LTEXT "-",IDC_QUERY_HOST,40,30,117,15,SS_CENTERIMAGE END -IDD_ADD_NEW_CLIENT DIALOG DISCARDABLE 0, 0, 183, 53 +IDD_ADD_NEW_CLIENT DIALOG DISCARDABLE 0, 0, 177, 52 STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "VNC Server : Add New Client" FONT 8, "MS Sans Serif" BEGIN - EDITTEXT IDC_HOST,70,10,105,15,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,70,32,50,14 - PUSHBUTTON "Cancel",IDCANCEL,125,32,50,14 - ICON IDI_ICON,IDC_STATIC,7,10,21,20,SS_REALSIZEIMAGE - CONTROL "Viewer:",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | - SS_CENTERIMAGE | WS_GROUP,35,10,30,15 + EDITTEXT IDC_HOST,80,10,90,15,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,80,31,40,14 + PUSHBUTTON "Cancel",IDCANCEL,125,31,45,14 + CONTROL 109,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE,7, + 10,33,31 + RTEXT "Viewer:",IDC_STATIC,45,10,30,15,SS_CENTERIMAGE +END + +IDD_CONTROL_PANEL DIALOG DISCARDABLE 0, 0, 267, 238 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | DS_CONTEXTHELP | + WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Control Panel" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "List1",IDC_LIST_CONNECTIONS,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | + WS_BORDER | WS_TABSTOP,7,25,253,76 + LTEXT "Authorised clients list",IDC_STATIC_KLIENTS_LIST,87,7, + 74,11,SS_CENTERIMAGE + GROUPBOX "Control of selected clients", + IDC_STATIC_SELECTED_KLIENTS,7,108,124,103 + PUSHBUTTON "View-only",IDC_VIEW_ONLY,13,121,111,14 + PUSHBUTTON "Full control ",IDC_FULL_CONTROL,13,145,112,14 + PUSHBUTTON "Stop updating",IDC_STOP_UPDATE,13,167,111,14 + PUSHBUTTON "Kill Clients",IDC_KILL_SEL_CLIENT,13,190,111,14 + PUSHBUTTON "Properties",IDC_PROPERTIES,144,121,111,14 + PUSHBUTTON "Add New Client",IDC_ADD_CLIENT,144,145,111,14 + PUSHBUTTON "Kill All Clients",IDC_KILL_ALL,144,167,111,14 + CONTROL "Disable New Clients",IDC_DISABLE_CLIENTS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,144,191,111,13 + PUSHBUTTON "Close",IDCANCEL,144,217,111,14 END +///////////////////////////////////////////////////////////////////////////// +// +// HTTPFILE +// + +/VNCVIEWER.JAR HTTPFILE DISCARDABLE "java\\vncviewer.jar" +/LOGO150X150.GIF HTTPFILE DISCARDABLE "java\\logo150x150.gif" +/INDEX.VNC HTTPFILE DISCARDABLE "java\\index.vnc" + +///////////////////////////////////////////////////////////////////////////// +// +// 24 +// + +IDR_MANIFEST 24 DISCARDABLE "winvnc4.exe.manifest" + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -165,6 +229,22 @@ END #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO DISCARDABLE BEGIN + IDD_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 5 + VERTGUIDE, 45 + VERTGUIDE, 170 + VERTGUIDE, 195 + VERTGUIDE, 242 + TOPMARGIN, 7 + BOTTOMMARGIN, 85 + HORZGUIDE, 10 + HORZGUIDE, 25 + HORZGUIDE, 40 + HORZGUIDE, 55 + HORZGUIDE, 70 + END + IDD_QUERY_CONNECT, DIALOG BEGIN LEFTMARGIN, 7 @@ -187,142 +267,50 @@ BEGIN IDD_ADD_NEW_CLIENT, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 176 - VERTGUIDE, 35 - VERTGUIDE, 65 - VERTGUIDE, 70 + RIGHTMARGIN, 170 + VERTGUIDE, 45 + VERTGUIDE, 75 + VERTGUIDE, 80 VERTGUIDE, 120 VERTGUIDE, 125 - VERTGUIDE, 175 + VERTGUIDE, 170 TOPMARGIN, 7 - BOTTOMMARGIN, 46 + BOTTOMMARGIN, 45 HORZGUIDE, 10 HORZGUIDE, 25 + HORZGUIDE, 30 + HORZGUIDE, 45 END -END -#endif // APSTUDIO_INVOKED - - -#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 - - -#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", "Constantin Kaplinsky\0" - VALUE "FileDescription", "TightVNC Server for Win32\0" - VALUE "FileVersion", "4.0\0" - VALUE "InternalName", "WinVNC 4.0\0" - VALUE "LegalCopyright", "Copyright (C) 1998-2004 [many holders]\0" - VALUE "LegalTrademarks", "TightVNC\0" - VALUE "OriginalFilename", "winvnc4.exe\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "TightVNC Server 4.0\0" - VALUE "ProductVersion", "4.0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1200 - END -END - -#endif // !_MAC - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON ICON DISCARDABLE "winvnc.ico" -IDI_CONNECTED ICON DISCARDABLE "connected.ico" -IDI_CONNECTED_DISABLE ICON DISCARDABLE "connecte.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_TRAY MENU DISCARDABLE -BEGIN - POPUP "Tray Menu" + IDD_CONTROL_PANEL, DIALOG BEGIN - MENUITEM "Control &Panel", ID_CONTR0L_PANEL - MENUITEM SEPARATOR - MENUITEM "&Options...", ID_OPTIONS - MENUITEM "Add &New Client", ID_CONNECT - MENUITEM "&Disconnect Clients", ID_DISCONNECT - MENUITEM "Disable New &Clients", ID_DISABLE_NEW_CLIENTS - MENUITEM SEPARATOR - MENUITEM "Close &VNC Server", ID_CLOSE - MENUITEM "&About...", ID_ABOUT + LEFTMARGIN, 7 + RIGHTMARGIN, 260 + VERTGUIDE, 13 + VERTGUIDE, 124 + VERTGUIDE, 144 + VERTGUIDE, 255 + TOPMARGIN, 7 + BOTTOMMARGIN, 231 + HORZGUIDE, 121 + HORZGUIDE, 135 + HORZGUIDE, 145 + HORZGUIDE, 159 + HORZGUIDE, 181 + HORZGUIDE, 191 + HORZGUIDE, 204 + HORZGUIDE, 217 END END +#endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // -// HTTPFILE -// - -/VNCVIEWER.JAR HTTPFILE DISCARDABLE "java\\vncviewer.jar" -/LOGO150X150.GIF HTTPFILE DISCARDABLE "java\\logo150x150.gif" -/INDEX.VNC HTTPFILE DISCARDABLE "java\\index.vnc" - -///////////////////////////////////////////////////////////////////////////// -// -// 24 +// Bitmap // -IDR_MANIFEST 24 DISCARDABLE "winvnc4.exe.manifest" +IDB_BITMAP BITMAP DISCARDABLE "winvnc.bmp" #endif // English (U.K.) resources /////////////////////////////////////////////////////////////////////////////