<code>
if
( hWnd )
{
TCHAR szBuf[MAX_CLASSNAME];
GetClassName(hWnd szBuf,MAX_CLASSNAME);
if
( lstrcmpi( szBuf, _T(
"msctls_updown32"
) ) == 0 )
{
DWORD dwStyle = GetWindowLong( hWnd, GWL_STYLE );
if
( ( dwStyle & UDS_ALIGNRIGHT || dwStyle & UDS_ALIGNLEFT ) &&
SendMessage( hWnd, UDM_GETBUDDY, 0, 0L ) == (LONG)m_hWnd )
{
RECT rc;
GetWindowRect( hWnd, &rc );
const
int nEdge = GetSystemMetrics( SM_CXEDGE );
if
( dwStyle & UDS_ALIGNRIGHT )
rect.right += ( rc.right - rc.left ) - nEdge;
else
rect.left -= ( rc.right - rc.left ) - nEdge;
HDC hDC = GetDC( hWnd );
COLORREF clr = GetSysColor( m_nState & dsHoverMask ? COLOR_3DDKSHADOW : COLOR_3DHIGHLIGHT );
if
( !IsWindowEnabled( m_hWnd ) )
clr = GetSysColor( COLOR_3DFACE );
FillSolidRect( hDC, 1, 1, rc.right - rc.left - nEdge - 1, 1, clr );
if
( dwStyle & UDS_ALIGNLEFT )
FillSolidRect( hDC, 1, 1, 1, rc.bottom - rc.top - nEdge - 1, clr );
ReleaseDC( hWnd, hDC );
}
}
}
3.错误提示
</code>