From f9d2e19d216beea3ada925054f9523cc581f0cf9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 3 Aug 2009 20:10:31 +0000 Subject: [PATCH] Always use MCHITTESTINFO of minimal size. This struct has gained additional fields under Vista which are not supported under previous versions. We don't use these fields but just using a bigger struct makes functions using it fail under pre-Vista systems, so don't do this. Closes #11057. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/calctrl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/msw/calctrl.cpp b/src/msw/calctrl.cpp index b97433d431..239abf65ca 100644 --- a/src/msw/calctrl.cpp +++ b/src/msw/calctrl.cpp @@ -166,6 +166,15 @@ wxCalendarCtrl::HitTest(const wxPoint& pos, wxDateTime::WeekDay *wd) { WinStruct hti; + + // Vista and later SDKs add a few extra fields to MCHITTESTINFO which are + // not supported by the previous versions, as we don't use them anyhow we + // should pretend that we always use the old struct format to make the call + // below work on pre-Vista systems (see #11057) +#ifdef MCHITTESTINFO_V1_SIZE + hti.cbSize = MCHITTESTINFO_V1_SIZE; +#endif + hti.pt.x = pos.x; hti.pt.y = pos.y; switch ( MonthCal_HitTest(GetHwnd(), &hti) ) -- 2.45.2