// Author: Royce Mitchell III, Vadim Zeitlin
// Modified by: Ryan Norton (IsPrimary override)
// Created: 06/21/02
-// RCS-ID: $Id$
// Copyright: (c) wxWidgets team
// Copyright: (c) 2002-2006 wxWidgets team
// Licence: wxWindows licence
#include "wx/frame.h"
#endif
-#include "wx/dynload.h"
+#include "wx/dynlib.h"
#include "wx/sysopt.h"
#include "wx/display_impl.h"
int wxDisplayFactoryMSW::GetFromWindow(const wxWindow *window)
{
+#ifdef __WXMSW__
return FindDisplayFromHMONITOR(gs_MonitorFromWindow(GetHwndOf(window),
MONITOR_DEFAULTTONULL));
+#else
+ const wxSize halfsize = window->GetSize() / 2;
+ wxPoint pt = window->GetScreenPosition();
+ pt.x += halfsize.x;
+ pt.y += halfsize.y;
+ return GetFromPoint(pt);
+#endif
}
#endif // wxUSE_DISPLAY
+
+void wxClientDisplayRect(int *x, int *y, int *width, int *height)
+{
+#if defined(__WXMICROWIN__)
+ *x = 0; *y = 0;
+ wxDisplaySize(width, height);
+#else
+ // Determine the desktop dimensions minus the taskbar and any other
+ // special decorations...
+ RECT r;
+
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
+ if (x) *x = r.left;
+ if (y) *y = r.top;
+ if (width) *width = r.right - r.left;
+ if (height) *height = r.bottom - r.top;
+#endif
+}