From fd334adb8cb963398268c6e6411859ca8887fb89 Mon Sep 17 00:00:00 2001 From: george82 Date: Mon, 29 May 2006 14:05:20 +0000 Subject: [PATCH] Added new exception rfb::UnsupportedPixelFormatException. Added DesktopWindow::getCallback(). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@600 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- win/vncviewer/DesktopWindow.cxx | 4 ++++ win/vncviewer/DesktopWindow.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx index 27ef2dc2..fce795ba 100644 --- a/win/vncviewer/DesktopWindow.cxx +++ b/win/vncviewer/DesktopWindow.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -70,6 +71,9 @@ LRESULT CALLBACK DesktopWindowProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa try { result = _this->processMessage(msg, wParam, lParam); + } catch (rfb::UnsupportedPixelFormatException &e) { + MsgBox(0, e.str(), MB_OK); + _this->getCallback()->closeWindow(); } catch (rdr::Exception& e) { vlog.error("untrapped: %s", e.str()); } diff --git a/win/vncviewer/DesktopWindow.h b/win/vncviewer/DesktopWindow.h index 3d2211f8..8511eb44 100644 --- a/win/vncviewer/DesktopWindow.h +++ b/win/vncviewer/DesktopWindow.h @@ -132,6 +132,8 @@ namespace rfb { virtual void refreshMenu(bool enableSysItems) = 0; }; + Callback *getCallback() const { return callback; } + // Currently accessible so that the CConn can releaseAllKeys & check // whether Ctrl and Alt are down... rfb::win32::CKeyboard kbd; -- 2.39.5