Aca les mando esta funcion, espero les sirva Es MUY util ehh
- Code: Select all Expand view RUN
//--------------------------------------------------------------------------------------------------//
FUNCTION ChangeStyleWindow( hoWnd, naStyle, nStyleType, lAdd )
local aStyles:= {}, n, hWnd, nStyleReturn:= 0
if ValType(hoWnd)$"O"
hWnd:= hoWnd:hWnd
else
hWnd:= hoWnd
endif
if ValType(naStyle)$"N;A"
if ValType(naStyle)$"N"
aStyles:= { naStyle }
else
aStyles:= aClone( naStyle )
endif
aEval(aStyles, {|nStyle| nStyleReturn:= __ChangeStyleWindow( hWnd, nStyle, nStyleType, lAdd ) } )
endif
return nStyleReturn
//--------------------------------------------------------------------------------------------------//
STATIC FUNCTION __ChangeStyleWindow( hWnd, nStyle, nStyleType, lAdd )
local nOldStyle, lExistStyle
local nStyleReturn:= 0
DEFAULT nStyleType:= GWL_STYLE,;
lAdd:= .T.
if ValType(hWnd)$"N" .and. ValType(nStyle)$"N" .and. ValType(nStyleType)$"N" .and. ValType(lAdd)$"L"
nOldStyle := GetWindowLong( hWnd, nStyleType )
lExistStyle:= lAnd( nStyle, nOldStyle )
if lAdd .and. !lExistStyle
SetWindowLong( hWnd, nStyleType, nOr( nOldStyle, nStyle ) )
elseif !lAdd .and. lExistStyle
SetWindowLong( hWnd, nStyleType, nAnd( nOldStyle, nNot(nStyle) ) )
endif
nStyleReturn:= GetWindowLong( hWnd, nStyleType )
endif
RETURN nStyleReturn