作者:BALLOONMAN2002 2004年6月26日
三、半透明效果实现
1、创建一个可视USER OBJECT对象,并在主窗口中创建该UO的实例变量。
2、声明本地外部函数:
Function ulong GetDC(ulong hwnd) LIBRARY "user32.dll"
Function ulong BitBlt(ulong hDestDC,ulong x,ulong y,ulong nWidth,ulong nHeight,ulong hSrcDC,ulong xSrc,ulong ySrc,ulong dwRop) LIBRARY "gdi32.dll"
Function ulong ReleaseDC(ulong hwnd,ulong hdc) LIBRARY "user32.dll"
Function ulong CreateCompatibleDC(ulong hdc) LIBRARY "gdi32.dll"
Function ulong CreateCompatibleBitmap(ulong hdc,ulong nWidth,ulong nHeight) LIBRARY "gdi32.dll"
SUBROUTINE Sleep(ulong dwMilliseconds) LIBRARY "kernel32.dll"
Function ulong SelectObject(ulong hdc,ulong hObject) LIBRARY "gdi32.dll"
Function ulong AlphaBlend(long hDestDC , long X, long Y , long nWidth , long nHeight, long hSrcDC,long xSrc,long ySrc, long WidthSrc, long HeightSrc ,long dreamAKA ) LIBRARY "msimg32"
Function ulong DeleteDC(ulong hdc) LIBRARY "gdi32.dll"
Function ulong GetSystemMetrics(ulong nIndex) LIBRARY "user32.dll"
SUBROUTINE CopyMemory2 (ref long Destination , blendfunction Source, long Length) LIBRARY "kernel32" Alias for "RtlMoveMemory"
Function ulong DeleteObject(ulong hObject) LIBRARY "gdi32.dll"
3、处理主窗口的TIMER事件,用于定期触发提示信息:
long ll_x,ll_y
if ii_tip > 0 then
if ib_tipshow then
ib_tipshow = false
iuo_tips.hide()
timer(0)
else
ib_tipshow = true
ll_x = w_main.pointerx() + 50
ll_y = w_main.pointery() - iuo_tips.height - 5
if ll_y < 2 then
ll_y = 2
end if
//wf_maketrans(iuo_tips,iuo_tips.mle_1,il_x,il_y,50)
wf_maketrans(iuo_tips,iuo_tips.mle_1,ll_x,ll_y,40)
//上述函数是用于实现半透明效果的函数
timer(6)
end if
end if