Applied better/Win98-proof method of getting edit window
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -443,16 +443,32 @@ WXHWND wxComboBox::GetEditHWNDIfAvailable() const
|
|||||||
// to keep one version of the code for all platforms and fix it later if
|
// to keep one version of the code for all platforms and fix it later if
|
||||||
// problems are discovered
|
// problems are discovered
|
||||||
|
|
||||||
#ifndef __WXWINCE__
|
typedef BOOL (WINAPI *GetComboBoxInfo_t)(HWND, COMBOBOXINFO*);
|
||||||
COMBOBOXINFO info;
|
static GetComboBoxInfo_t s_pfnGetComboBoxInfo = NULL;
|
||||||
info.cbSize = sizeof(COMBOBOXINFO);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HasFlag(wxCB_SIMPLE))
|
||||||
|
{
|
||||||
|
POINT pt;
|
||||||
|
pt.x = pt.y = 4;
|
||||||
|
return (WXHWND) ::ChildWindowFromPoint(GetHwnd(), pt);
|
||||||
|
}
|
||||||
|
|
||||||
GetComboBoxInfo(GetHwnd(), & info);
|
|
||||||
return info.hwndItem;
|
|
||||||
#else
|
|
||||||
// we assume that the only child of the combobox is the edit window
|
// we assume that the only child of the combobox is the edit window
|
||||||
return (WXHWND)::GetWindow(GetHwnd(), GW_CHILD);
|
return (WXHWND)::GetWindow(GetHwnd(), GW_CHILD);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WXHWND wxComboBox::GetEditHWND() const
|
WXHWND wxComboBox::GetEditHWND() const
|
||||||
|
Reference in New Issue
Block a user