19 de diciembre de 2002

Formulario Triangular

Muchos de nosotros estamos cansados de los tipicos formularios rectangulares, ahora podemos hacer un formulario triangular de una manera simple ...

Coloca un formulario y escribe en el INIT:
#DEFINE C_ALTERNATE 1
#DEFINE C_WINDING 2

declare integer CreatePolygonRgn in gdi32 ;
   string@ ppoints, integer npoints, integer nfillmode
declare integer SetWindowRgn in user32 ;
   integer hWnd, integer hRgn , integer bRedraw

cPoints = num2dword(0)+num2dword(0);
   +num2dword(THIS.Width+(sysmetric(13)*1));
   +num2dword(THIS.Height+sysmetric(9)+(sysmetric(12)*2));
   +num2dword(0)+num2dword(THIS.Height+sysmetric(9)+(sysmetric(12)*2))

set library to foxtools.fll

lnw = _WFindTitl(THIS.Caption)
lnh = _WhToHWnd(lnw)
lnr = CreatePolygonRgn(@cPoints, 3, C_WINDING)

SetWindowRgn(lnh, lnr, 1)
return
Luego, crea un .PRG llamado num2dword y coloca lo siguiente:
procedure Num2dword
lparameter tnNum
local c0,c1,c2,c3
lcresult = chr(0)+chr(0)+chr(0)+chr(0)
if tnNum < (2^31 - 1) then
   c3 = chr(int(tnNum/(256^3)))
   tnNum = mod(tnNum,256^3)
   c2 = chr(int(tnNum/(256^2)))
   tnNum = mod(tnNum,256^2)
   c1 = chr(int(tnNum/256))
   c0 = chr(mod(tnNum,256))
   lcresult = c0+c1+c2+c3
else
   * no es un numero valido para DWORD
endif
return lcresult
Mauricio Henao Romero

1 comentario :