diff --git a/src/msw/window.cpp b/src/msw/window.cpp index c1fc8169e8..2fdb69c2e8 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -512,8 +512,14 @@ void wxWindowMSW::SetId(wxWindowID winid) // changing its ID because Windows still uses the old one. if ( GetHwnd() ) { + ::SetLastError(0); + if ( !::SetWindowLong(GetHwnd(), GWL_ID, winid) ) - wxLogLastError(wxT("SetWindowLong(GWL_ID)")); + { + const DWORD err = ::GetLastError(); + if ( err ) + wxLogApiError(wxT("SetWindowLong(GWL_ID)"), err); + } } }