X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a71d815bbe669ebb9bdb9409926a272c37a5a9aa..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/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; } // ---------------------------------------------------------------------------