专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > PB

PB9以下版本实现窗口渐进淡出的方法!解决方案

发布时间:2011-06-29 20:31:33 文章来源:www.iduyao.cn 采编人员:星星草
PB9以下版本实现窗口渐进淡出的方法!!
1、先打开记事本,复制粘贴下面所有代码进去, 另存为:w_transparentcy.srw
2、在PB9里import w_transparentcy.srw  
3、run一下,看效果爽不爽。 要使用就继承。。。。


$PBExportHeader$w_transparentcy.srw
$PBExportComments$渐进淡出效果
forward
global type w_transparentcy from window
end type
end forward

global type w_transparentcy from window
integer width = 2533
integer height = 1408
boolean titlebar = true
string title = "test"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
event ue_open ( )
end type
global w_transparentcy w_transparentcy

type prototypes
Function ulong SetLayeredWindowAttributes(ulong hWnd , long crKey , Character bAlpha ,long dwFlags) library"user32.dll"
FUNCTION ulong SetWindowulong(ulong hwnd,ulong nIndex,ulong dwNewLong) LIBRARY "user32.dll" ALIAS FOR "SetWindowLongA"

end prototypes

type variables
ulong GWL_WNDPROC = -4
ulong GWL_HINSTANCE = -6
ulong GWL_STYLE = -16
ulong GWL_EXSTYLE = -20
ulong GWL_USERDATA = -21
ulong GWL_ID = -12
ulong DWL_MSGRESULT = 0
ulong DWL_DLGPROC = 4
ulong DWL_USER = 8
ulong WS_EX_LAYERED = 524288
long LWA_COLORKEY = 1
long LWA_ALPHA = 2
long transparentcy=0
end variables

forward prototypes
public subroutine of_setalpha (integer tspcy)
end prototypes

event ue_open();do until transparentcy =255
transparentcy ++
  of_setalpha(transparentcy)
  sleep(0.45)
loop


end event

public subroutine of_setalpha (integer tspcy);//设置窗口新的扩展属性 
 SetWindowulong(Handle(This), GWL_EXSTYLE, WS_EX_LAYERED)
//设置透明度 
 SetLayeredWindowAttributes(Handle(This), rgb(0,255,0), Char(tspcy), 2)

end subroutine

on w_transparentcy.create
end on

on w_transparentcy.destroy
end on

event closequery;do until transparentcy =0
transparentcy --
  of_setalpha(transparentcy)
  sleep(0.45)
loop


end event

event open;of_setalpha(0)
postevent ('ue_open')
end event



------解决方案--------------------
顶,支持技术共享
------解决方案--------------------
上次给客户做了一个小功能也用到了淡入淡出加消隐。
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: