+ //
+ // Originally created before Panel was properly sized, most likely.
+ // So now the the panel is sized correctly, resize the scrollbars
+ // and bring them to the top of all the other panel children
+ //
+ if (m_hWndScrollBarVert != NULLHANDLE ||
+ m_hWndScrollBarHorz != NULLHANDLE)
+ {
+ RECTL vRect;
+
+ ::WinQueryWindowRect(GetHwnd(), &vRect);
+ ::WinQueryWindowPos(m_hWndScrollBarHorz, &vSwp);
+ if ( (vRect.xRight - vRect.xLeft) - vSwp.cx != 20)
+ {
+ ::WinSetWindowPos( m_hWndScrollBarHorz
+ ,HWND_TOP
+ ,0
+ ,0
+ ,(vRect.xRight - vRect.xLeft) - 20
+ ,vSwp.cy
+ ,SWP_ZORDER | SWP_SIZE
+ );
+ }
+ else
+ {
+ ::WinSetWindowPos( m_hWndScrollBarHorz
+ ,HWND_TOP
+ ,0
+ ,0
+ ,0
+ ,0
+ ,SWP_ZORDER
+ );
+ }
+ ::WinQueryWindowPos(m_hWndScrollBarVert, &vSwp);
+ if ( (vRect.yTop - vRect.yBottom) - vSwp.cy != 20)
+ {
+ ::WinSetWindowPos( m_hWndScrollBarVert
+ ,HWND_TOP
+ ,vSwp.x
+ ,vSwp.y + 20
+ ,vSwp.cx
+ ,(vRect.yTop - vRect.yBottom) - 20
+ ,SWP_ZORDER | SWP_SIZE | SWP_MOVE
+ );
+ }
+ else
+ {
+ ::WinSetWindowPos( m_hWndScrollBarVert
+ ,HWND_TOP
+ ,0
+ ,0
+ ,0
+ ,0
+ ,SWP_ZORDER
+ );
+ }
+ ::WinQueryWindowRect(m_hWndScrollBarHorz, &vRect);
+ ::WinInvalidateRect(m_hWndScrollBarHorz, &vRect, FALSE);
+ ::WinQueryWindowRect(m_hWndScrollBarVert, &vRect);
+ ::WinInvalidateRect(m_hWndScrollBarVert, &vRect, FALSE);
+ }