Formularios transparentes
Visual Fox Pro, Trucos Comentarios ( 0 ) »oForm =
Createobject("Tform")
oForm.Visible
= .T.
Read Events
Define Class tform
As Form
#Define
LWA_COLORKEY 1
#Define
LWA_ALPHA 2
#Define
GWL_EXSTYLE -20
#Define
WS_EX_LAYERED 0x80000
AutoCenter=.T.
Caption="Transparent
Form"
ShowWindow=2
Add Object
cmdSet
As CommandButton With;
Left=10,;
Top=10,;
Height=27,;
Width=80,;
Caption="Set"
Add Object
cmdClear
As CommandButton With;
Left=100,;
Top=10,;
Height=27,;
Width=80,;
Caption="Clear"
Procedure Init
Declare Integer GetWindowLong
In
user32;
INTEGER HWnd,
Integer
nIndex
Declare Integer
SetWindowLong
In
user32;
INTEGER HWnd,
Integer
nIn,
Integer
dwNLong
Declare Integer
SetLayeredWindowAttributes
In
user32;
INTEGER HWnd,
Integer
crKey,;
SHORT
bAlpha,
Integer
dwFlags
Procedure Destroy
Clear Events
Procedure SetMode
Local
nExStyle
nExStyle=GetWindowLong(This.HWnd,
GWL_EXSTYLE)
nExStyle=Bitor(nExStyle,
WS_EX_LAYERED)
=SetWindowLong(This.HWnd,
GWL_EXSTYLE, nExStyle)
=SetLayeredWindowAttributes(This.HWnd,
0,;
128, LWA_ALPHA)
Procedure
ClearMode
Local
nExStyle
nExStyle=GetWindowLong(This.HWnd,
GWL_EXSTYLE)
nExStyle=Bitxor(nExStyle,
WS_EX_LAYERED)
=SetWindowLong(This.HWnd,
GWL_EXSTYLE, nExStyle)
Procedure
cmdSet.Click
Thisform.SetMode
Procedure
cmdClear.Click
Thisform.ClearMode
Enddefine
Por: David Amador T