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