aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-07-14 19:41:09 +1000
committernyamatongwe <unknown>2010-07-14 19:41:09 +1000
commit9dadf660f6eba33cf8e6be63e120437e4b8c5f36 (patch)
tree0133123d834b481044901202d7026736ecda2c96
parent8a34c1bd2049a0ff500c44a248e136e87d5fed35 (diff)
downloadscintilla-mirror-9dadf660f6eba33cf8e6be63e120437e4b8c5f36.tar.gz
Visual C++ 98 has problems with MultiMon.h.
Avoid including it for Visual C++ 98 and work around its absence.
-rw-r--r--win32/PlatWin.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index ab71dbe77..d9a0962ad 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -27,7 +27,7 @@
// We want to use multi monitor functions, but via LoadLibrary etc
// Luckily microsoft has done the heavy lifting for us, so we'll just use their stub functions!
-#if defined(_MSC_VER) || defined(__BORLANDC__)
+#if (defined(_MSC_VER) && (MSC_VER > 1200)) || defined(__BORLANDC__)
#define COMPILE_MULTIMON_STUBS
#include "MultiMon.h"
#endif
@@ -1041,6 +1041,8 @@ void Window::SetPositionRelative(PRectangle rc, Window w) {
::GetWindowRect(reinterpret_cast<HWND>(w.GetID()), &rcOther);
rc.Move(rcOther.left, rcOther.top);
+ // This #ifdef is for VC 98 which has problems with MultiMon.h under some conditions.
+#ifdef MONITOR_DEFAULTTONULL
// We're using the stub functionality of MultiMon.h to decay gracefully on machines
// (ie, pre Win2000, Win95) that do not support the newer functions.
RECT rcMonitor;
@@ -1064,6 +1066,7 @@ void Window::SetPositionRelative(PRectangle rc, Window w) {
rc.Move(mi.rcWork.left - rc.left, 0);
if (rc.top < mi.rcWork.top)
rc.Move(0, mi.rcWork.top - rc.top);
+#endif
}
SetPosition(rc);
}
@@ -1148,6 +1151,7 @@ void Window::SetTitle(const char *s) {
/* Returns rectangle of monitor pt is on, both rect and pt are in Window's
coordinates */
PRectangle Window::GetMonitorRect(Point pt) {
+#ifdef MONITOR_DEFAULTTONULL
// MonitorFromPoint and GetMonitorInfo are not available on Windows 95 so are not used.
// There could be conditional code and dynamic loading in a future version
// so this would work on those platforms where they are available.
@@ -1167,6 +1171,9 @@ PRectangle Window::GetMonitorRect(Point pt) {
} else {
return PRectangle();
}
+#else
+ return PRectangle();
+#endif
}
struct ListItemData {