Hasa, substitua novamente a função MyEvents():
function MyEvents ( hWnd, nMsg, wParam, lParam )
if nMsg != 275
n_Secs:=SECONDS()
if nMsg == 312
i := AScan ( _HMG_aControlHandles , lParam )
if i > 0
TmpStr := _HMG_aControlType [i]
if TmpStr $ "GETBOX,LABEL,HYPERLINK,CHECKBOX,FRAME,SLIDER,NUMTEXT,MASKEDTEXT,CHARMASKTEXT,BTNTEXT,BTNNUMTEXT,EDIT,CHECKLABEL"
if TmpStr $ "GETBOX,NUMTEXT,MASKEDTEXT,CHARMASKTEXT,BTNTEXT,BTNNUMTEXT,EDIT"
if IsWindowEnabled( _HMG_aControlHandles[ i ] )
if _HMG_aControlFontColor [ i ] != Nil
if ValType( _HMG_aControlFontColor [ i , 2] ) == "A" .AND. Len( _HMG_aControlFontColor [ i , 2] ) == 3
SetTextColor( wParam, _HMG_aControlFontColor [ i , 2 , 1 ], _HMG_aControlFontColor [ i , 2 , 2 ], _HMG_aControlFontColor [ i , 2 , 3 ] )
elseif ValType( _HMG_aControlFontColor [ i , 2 ] ) == "N" .AND. Len( _HMG_aControlFontColor [ i ] ) == 3
SetTextColor( wParam, _HMG_aControlFontColor [ i , 1 ], _HMG_aControlFontColor [ i , 2 ], _HMG_aControlFontColor [ i , 3 ] )
endif
endif
if _HMG_aControlBkColor [ i ] != Nil
if ValType( _HMG_aControlBkColor [ i , 2 ] ) == "A" .AND. Len( _HMG_aControlBkColor [ i , 2 ] ) == 3
SetBkColor( wParam , _HMG_aControlBkColor [ i , 2 , 1 ] , _HMG_aControlBkColor [ i , 2 , 2 ] , _HMG_aControlBkColor [ i , 2 , 3 ] )
DeleteObject ( _HMG_aControlBrushHandle [ i ] )
_HMG_aControlBrushHandle [ i ] := CreateSolidBrush( _HMG_aControlBkColor [ i , 2 , 1 ] , _HMG_aControlBkColor [ i , 2 , 2 ] , _HMG_aControlBkColor [ i , 2 , 3 ] )
RETURN ( _HMG_aControlBrushHandle [ i ] )
ELSE
if ValType( _HMG_aControlBkColor [ i , 2] ) == "N" .AND. Len( _HMG_aControlBkColor [ i ] ) == 3
SetBkColor( wParam , _HMG_aControlBkColor [ i , 1 ] , _HMG_aControlBkColor [ i , 2 ] , _HMG_aControlBkColor [ i , 3 ] )
DeleteObject ( _HMG_aControlBrushHandle [ i ] )
_HMG_aControlBrushHandle [ i ] := CreateSolidBrush( _HMG_aControlBkColor [ i , 1 ] , _HMG_aControlBkColor [ i , 2 ] , _HMG_aControlBkColor [ i , 3 ] )
RETURN ( _HMG_aControlBrushHandle [ i ] )
endif
endif
ELSE
SetBkColor( wParam , GetRed ( GetSysColor ( COLOR_3DFACE ) ) , GetGreen ( GetSysColor ( COLOR_3DFACE ) ) , GetBlue ( GetSysColor ( COLOR_3DFACE ) ) )
DeleteObject ( _HMG_aControlBrushHandle [ i ] )
_HMG_aControlBrushHandle [ i ] := CreateSolidBrush( GetRed ( GetSysColor ( COLOR_3DFACE ) ) , GetGreen ( GetSysColor ( COLOR_3DFACE ) ) , GetBlue ( GetSysColor (COLOR_3DFACE ) ) )
RETURN ( _HMG_aControlBrushHandle [ i ] )
endif
endif
ELSE
if IsXPThemed == Nil
IsXPThemed := IsThemed()
endif
Tmp := _HMG_aControlContainerRow [i] <> -1 .AND. _HMG_aControlContainerCol [i] <> -1 .AND. _HMG_aControlBkColor [i] == Nil
if IsXPThemed .AND. TmpStr == "SLIDER" .AND. Tmp
if _HMG_aControlDblClick [i] == .F. .AND. !lOpaque
r := GetControlIndex( _HMG_aControlFontHandle [i], _HMG_aControlMiscData1 [i] )
DeleteObject ( _HMG_aControlBrushHandle [r] )
z := GetControlHandle( _HMG_aControlFontHandle [i], _HMG_aControlMiscData1 [i] )
_HMG_aControlBrushHandle [r] := GetTabBrush( z )
RETURN GetTabbedControlBrush ( wParam , lParam , z , _HMG_aControlBrushHandle [r] )
endif
endif
if IsXPThemed .AND. TmpStr == "FRAME" .AND. Tmp
if _HMG_aControlDblClick [i] == .F.
r := GetControlIndex( _HMG_aControlRangeMin [i], _HMG_aControlRangeMax [i] )
DeleteObject ( _HMG_aControlBrushHandle [r] )
z := GetControlHandle( _HMG_aControlRangeMin [i], _HMG_aControlRangeMax [i] )
_HMG_aControlBrushHandle [r] := GetTabBrush( z )
RETURN GetTabbedControlBrush ( wParam , lParam , z , _HMG_aControlBrushHandle [r] )
ELSE
lOpaque := .T.
endif
endif
if IsXPThemed .AND. TmpStr == "CHECKBOX" .AND. Tmp
if _HMG_aControlDblClick [i] == .F. .AND. !lOpaque
r := GetControlIndex( _HMG_aControlRangeMin [i], _HMG_aControlRangeMax [i] )
DeleteObject ( _HMG_aControlBrushHandle [r] )
z := GetControlHandle( _HMG_aControlRangeMin [i], _HMG_aControlRangeMax [i] )
_HMG_aControlBrushHandle [r] := GetTabBrush( z )
RETURN GetTabbedControlBrush ( wParam , lParam , z , _HMG_aControlBrushHandle [r] )
endif
endif
if _HMG_aControlFontColor [i] != Nil
SetTextColor( wParam , _HMG_aControlFontColor [i] [1] , _HMG_aControlFontColor [i] [2] , _HMG_aControlFontColor [i] [3] )
endif
if ValType ( _HMG_aControlInputMask [i] ) == 'L'
if _HMG_aControlInputMask [i] == .T.
SetBkMode( wParam , 1 )
RETURN( GetStockObject( NULL_BRUSH ) )
endif
endif
if _HMG_aControlBkColor [i] != Nil
SetBkColor( wParam , _HMG_aControlBkColor [i] [1] , _HMG_aControlBkColor [i] [2] , _HMG_aControlBkColor [i] [3] )
DeleteObject ( _HMG_aControlBrushHandle [i] )
_HMG_aControlBrushHandle [i] := CreateSolidBrush( _HMG_aControlBkColor [i] [1] , _HMG_aControlBkColor [i] [2] , _HMG_aControlBkColor [i] [3] )
RETURN ( _HMG_aControlBrushHandle [i] )
ELSE
DeleteObject ( _HMG_aControlBrushHandle [i] )
_HMG_aControlBrushHandle [i] := CreateSolidBrush( GetRed ( GetSysColor ( COLOR_3DFACE ) ) , GetGreen ( GetSysColor ( COLOR_3DFACE ) ) , GetBlue ( GetSysColor ( COLOR_3DFACE ) ) )
SetBkColor( wParam , GetRed ( GetSysColor ( COLOR_3DFACE ) ) , GetGreen ( GetSysColor ( COLOR_3DFACE ) ) , GetBlue ( GetSysColor ( COLOR_3DFACE ) ) )
RETURN ( _HMG_aControlBrushHandle [i] )
endif
endif
endif
ELSE
FOR i := 1 TO Len ( _HMG_aControlhandles )
if ValType ( _HMG_aControlHandles [i] ) == 'A'
if _HMG_aControlType [i] == 'RADIOGROUP'
FOR x := 1 TO Len ( _HMG_aControlHandles [i] )
if _HMG_aControlHandles [i] [x] == lParam
if _HMG_aControlFontColor [i] != Nil
SetTextColor( wParam , _HMG_aControlFontColor [i] [1] , _HMG_aControlFontColor [i] [2] , _HMG_aControlFontColor [i] [3] )
endif
if IsXPThemed == Nil
IsXPThemed := IsThemed()
endif
if IsXPThemed .AND. _HMG_aControlContainerRow [i] <> -1 .AND. _HMG_aControlContainerCol [i] <> -1
if _HMG_aControlDblClick [i] == .F. .AND. !lOpaque .AND. _HMG_aControlBkColor [i] == Nil
r := GetControlIndex( _HMG_aControlRangeMin [i], _HMG_aControlRangeMax [i] )
DeleteObject ( _HMG_aControlBrushHandle [r] )
z := GetControlHandle( _HMG_aControlRangeMin [i], _HMG_aControlRangeMax [i] )
_HMG_aControlBrushHandle [r] := GetTabBrush( z )
RETURN GetTabbedControlBrush ( wParam , lParam , z , _HMG_aControlBrushHandle [r] )
endif
endif
if ValType ( _HMG_aControlInputMask [i] ) == 'L'
if _HMG_aControlInputMask [i] == .T.
SetBkMode( wParam , 1 )
RETURN ( GetStockObject( NULL_BRUSH ) )
endif
endif
if _HMG_aControlBkColor [i] != Nil
SetBkColor( wParam , _HMG_aControlBkColor [i] [1] , _HMG_aControlBkColor [i] [2] , _HMG_aControlBkColor [i] [3] )
if x == 1
DeleteObject ( _HMG_aControlBrushHandle [i] )
_HMG_aControlBrushHandle [i] := CreateSolidBrush( _HMG_aControlBkColor [i] [1] , _HMG_aControlBkColor [i] [2] , _HMG_aControlBkColor [i] [3] )
endif
RETURN ( _HMG_aControlBrushHandle [i] )
ELSE
if x == 1
DeleteObject ( _HMG_aControlBrushHandle [i] )
_HMG_aControlBrushHandle [i] := CreateSolidBrush( GetRed ( GetSysColor ( COLOR_3DFACE ) ) , GetGreen ( GetSysColor ( COLOR_3DFACE ) ) , GetBlue ( GetSysColor ( COLOR_3DFACE ) ) )
endif
SetBkColor( wParam , GetRed ( GetSysColor ( COLOR_3DFACE ) ) , GetGreen ( GetSysColor ( COLOR_3DFACE ) ) , GetBlue ( GetSysColor ( COLOR_3DFACE ) ) )
RETURN ( _HMG_aControlBrushHandle [i] )
endif
endif
NEXT x
endif
endif
NEXT i
endif
endif
endif
Events ( hWnd, nMsg, wParam, lParam )
Return (0)
Abraços,