fixed wrong return value and child creation login in GetWindowChild() (includes patch 1506083)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-06-14 15:55:43 +00:00
parent d0a84b6338
commit 9aa21ba171

View File

@@ -146,20 +146,14 @@ wxWindow* wxWindow::GetWindowChild(wxWindowID id)
wxWindow* win = GetWindowChild1(id);
if ( !win )
{
HWND hWnd = ::GetDlgItem((HWND) GetHWND(), id);
if (hWnd)
HWND hwnd = ::GetDlgItem(GetHwnd(), id);
if ( hwnd )
{
wxWindow* child = CreateWindowFromHWND(this, (WXHWND) hWnd);
if (child)
{
child->AddChild(this);
return child;
}
win = CreateWindowFromHWND(this, (WXHWND) hwnd);
}
}
return NULL;
return win;
}
// ---------------------------------------------------------------------------