X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a71d815bbe669ebb9bdb9409926a272c37a5a9aa..c782096417f0fd9de6c6d47b23174233ec6bcf57:/src/msw/nativdlg.cpp diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp index 5e6ff9865a..0f86383b8d 100644 --- a/src/msw/nativdlg.cpp +++ b/src/msw/nativdlg.cpp @@ -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; } // ---------------------------------------------------------------------------