/////////////////////////////////////////////////////////////////////////////
-// Name: display.cpp
+// Name: src/msw/display.cpp
// Purpose: MSW Implementation of wxDisplay class
// Author: Royce Mitchell III
// Modified by: VZ (resolutions enumeration/change support, DirectDraw, ...)
-// Ryan Norton (IsPrimary override)
+// Ryan Norton (IsPrimary override)
// Created: 06/21/02
// RCS-ID: $Id$
// Copyright: (c) wxWidgets team
// with mingw32, we must include windows.h first and it doesn't hurt with other
// compilers
-#include <windows.h>
-
-#include <multimon.h>
+#include "wx/msw/wrapwin.h"
+
+#ifndef __WXWINCE__
+ #include <multimon.h>
+
+ // HMONITOR can be declared either in new enough windef.h or in multimon.h
+ // itself if _WIN32_WINNT < 0x0500, but the trouble is that we set
+ // _WIN32_WINNT to maximal possible value ourselves in wx/msw/wrapwin.h so
+ // that multimon.h doesn't define it but with old headers, neither does
+ // windef.h, in spite of _WIN32_WINNT value. Even more unfortunately, we
+ // can't directly test whether HMONITOR is defined or not in windef.h as
+ // it's not a macro but a typedef, so we test for an unrelated symbol which
+ // is only defined in winuser.h if WINVER >= 0x0500
+ #if !defined(HMONITOR_DECLARED) && !defined(MNS_NOCHECK)
+ DECLARE_HANDLE(HMONITOR);
+ #define HMONITOR_DECLARED
+ #endif
+#endif // !__WXWINCE__
#ifdef _MSC_VER
#pragma warning(default:4706)
dm.dmDisplayFrequency > 1 ? dm.dmDisplayFrequency : 0);
}
+#ifndef __WXWINCE__
// emulation of ChangeDisplaySettingsEx() for Win95
LONG WINAPI ChangeDisplaySettingsExForWin95(LPCTSTR WXUNUSED(lpszDeviceName),
LPDEVMODE lpDevMode,
{
return ::ChangeDisplaySettings(lpDevMode, dwFlags);
}
+#endif // !__WXWINCE__
// ----------------------------------------------------------------------------
// wxDisplayModule
//RN: FIXME: This is wrong - the display info array should reload after every call
//to GetCount() - otherwise it will not be accurate.
//The user can change the number of displays in display properties/settings
- //after GetCount or similar is called and really mess this up...
+ //after GetCount or similar is called and really mess this up...
//wxASSERT_MSG( gs_displays->GetCount() == (size_t)::GetSystemMetrics(SM_CMONITORS),
// _T("So how many displays does this system have?") );
pDevMode = &dm;
+#ifdef __WXWINCE__
+ flags = 0;
+#else // !__WXWINCE__
flags = CDS_FULLSCREEN;
+#endif // __WXWINCE__/!__WXWINCE__
}
}
//else: huh, no user32.dll??
+#ifndef __WXWINCE__
if ( !pfnChangeDisplaySettingsEx )
{
// we must be under Win95 and so there is no multiple monitors
// support anyhow
pfnChangeDisplaySettingsEx = ChangeDisplaySettingsExForWin95;
}
+#endif // !__WXWINCE__
}
// do change the mode