]> git.saurik.com Git - wxWidgets.git/commitdiff
Always use MCHITTESTINFO of minimal size.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 3 Aug 2009 20:10:31 +0000 (20:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 3 Aug 2009 20:10:31 +0000 (20:10 +0000)
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

index b97433d43175b28f4f5e3825f3a208cee5221ecf..239abf65cae39e83baa225cca7a44b94a9ff8559 100644 (file)
@@ -166,6 +166,15 @@ wxCalendarCtrl::HitTest(const wxPoint& pos,
                         wxDateTime::WeekDay *wd)
 {
     WinStruct<MCHITTESTINFO> 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) )