作者: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