From f676b38715b824753e5440f133690b04e3faaf58 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 29 Jul 2003 18:53:35 +0000 Subject: [PATCH] Don't log errors from GetScrollInfo since it is possible that there will be an error return when there isn't actually an error (ie. when the window doesn't have scrollbars yet.) Left the if... statements in place in case we want to add an assert there later. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index a9f4e8312e..ec797d31d7 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -765,14 +765,15 @@ inline int GetScrollPosition(HWND hWnd, int wOrient) #ifdef __WXMICROWIN__ return ::GetScrollPosWX(hWnd, wOrient); #else - SCROLLINFO scrollInfo; + WinStruct scrollInfo; scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.fMask = SIF_POS; if ( !::GetScrollInfo(hWnd, - wOrient, - &scrollInfo) ) + wOrient, + &scrollInfo) ) { - wxLogLastError(_T("GetScrollInfo")); + // Not neccessarily an error, if there are no scrollbars yet. + // wxLogLastError(_T("GetScrollInfo")); } return scrollInfo.nPos; // return ::GetScrollPos(hWnd, wOrient); @@ -799,13 +800,15 @@ int wxWindowMSW::GetScrollRange(int orient) const ::GetScrollRange(hWnd, orient == wxHORIZONTAL ? SB_HORZ : SB_VERT, &minPos, &maxPos); #endif - SCROLLINFO scrollInfo; + WinStruct scrollInfo; scrollInfo.fMask = SIF_RANGE; if ( !::GetScrollInfo(hWnd, - orient == wxHORIZONTAL ? SB_HORZ : SB_VERT, - &scrollInfo) ) + orient == wxHORIZONTAL ? SB_HORZ : SB_VERT, + &scrollInfo) ) { - wxLogLastError(_T("GetScrollInfo")); + // Most of the time this is not really an error, since the return + // value can also be zero when there is no scrollbar yet. + // wxLogLastError(_T("GetScrollInfo")); } maxPos = scrollInfo.nMax; @@ -1008,10 +1011,10 @@ bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc) wxString str(wxGetWindowClass(hWnd)); if (str == wxCanvasClassName || str == wxCanvasClassNameNR || - str == wxMDIFrameClassName || - str == wxMDIFrameClassNameNoRedraw || - str == wxMDIChildFrameClassName || - str == wxMDIChildFrameClassNameNoRedraw || + str == wxMDIFrameClassName || + str == wxMDIFrameClassNameNoRedraw || + str == wxMDIChildFrameClassName || + str == wxMDIChildFrameClassNameNoRedraw || str == _T("wxTLWHiddenParent")) return TRUE; // Effectively means don't subclass else @@ -4715,7 +4718,8 @@ bool wxWindowMSW::MSWOnScroll(int orientation, WXWORD wParam, : SB_VERT, &scrollInfo) ) { - wxLogLastError(_T("GetScrollInfo")); + // Not neccessarily an error, if there are no scrollbars yet. + // wxLogLastError(_T("GetScrollInfo")); } event.SetPosition(scrollInfo.nTrackPos); -- 2.47.2