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
diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx
index 27ef2dc..fce795b 100644
--- a/win/vncviewer/DesktopWindow.cxx
+++ b/win/vncviewer/DesktopWindow.cxx
@@ -25,6 +25,7 @@
 #include <rfb_win32/MonitorInfo.h>
 #include <rfb_win32/DeviceContext.h>
 #include <rfb_win32/Win32Util.h>
+#include <rfb_win32/MsgBox.h>
 #include <vncviewer/DesktopWindow.h>
 #include <vncviewer/resource.h>
 
@@ -70,6 +71,9 @@
 
   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 3d2211f..8511eb4 100644
--- a/win/vncviewer/DesktopWindow.h
+++ b/win/vncviewer/DesktopWindow.h
@@ -132,6 +132,8 @@
         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;