]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
using on all OSX variants
[wxWidgets.git] / src / msw / combobox.cpp
index 8fbcce2237fc16541b1d0baad54a1035a247cb78..84b1bca018f7d2a220f8d3f8732dce093cbf0b06 100644 (file)
@@ -438,6 +438,32 @@ bool wxComboBox::MSWShouldPreProcessMessage(WXMSG *pMsg)
 
 WXHWND wxComboBox::GetEditHWNDIfAvailable() const
 {
+#if defined(WINVER) && WINVER >= 0x0500
+    typedef BOOL (WINAPI *GetComboBoxInfo_t)(HWND, COMBOBOXINFO*);
+    static GetComboBoxInfo_t s_pfnGetComboBoxInfo = NULL;
+    static bool s_triedToLoad = false;
+    if ( !s_triedToLoad )
+    {
+        s_triedToLoad = true;
+        wxLoadedDLL dllUser32("user32.dll");
+        wxDL_INIT_FUNC(s_pfn, GetComboBoxInfo, dllUser32);
+    }
+
+    if ( s_pfnGetComboBoxInfo )
+    {
+        WinStruct<COMBOBOXINFO> info;
+        (*s_pfnGetComboBoxInfo)(GetHwnd(), &info);
+        return info.hwndItem;
+    }
+#endif
+
+    if (HasFlag(wxCB_SIMPLE))
+    {
+        POINT pt;
+        pt.x = pt.y = 4;
+        return (WXHWND) ::ChildWindowFromPoint(GetHwnd(), pt);
+    }
+
     // notice that a slightly safer alternative could be to use FindWindowEx()
     // but it's not available under WinCE so just take the first child for now
     // to keep one version of the code for all platforms and fix it later if