X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ad495fb65c1bf8eaf28037384b9426e217049b6..c01359d9d5a834a93c0b68425aa8fefdd88124ee:/src/msw/display.cpp diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 536bd14811..59367a8f7e 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -58,6 +58,19 @@ #ifndef __WXWINCE__ #include + + // 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