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