[快捷功能]: | | |

窗体透明源码

[不指定 2007年1月25日星期四 14:38 | by 九天狼 | 出处:本站原创 ] | |
↓看看这下面↓
↑诱惑你自己↑
下面是模块代码

'窗体透明代码开始
Public Const WS_EX_LAYERED = &H80000
Public Const GWL_EXSTYLE = (-20)
Public Const LWA_ALPHA = &H2
Public Const LWA_COLORKEY = &H1
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
'窗体透明代码结束

下面是使用代码:最下边的一行中的255为透明度.值为0-255,0为完全透明,255为完全不透明

   Dim rtn As Long
   rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
   rtn = rtn Or WS_EX_LAYERED
   SetWindowLong hwnd, GWL_EXSTYLE, rtn
   SetLayeredWindowAttributes hwnd, 0, 255, LWA_ALPHA


最后编辑: 九天狼 编辑于2007年2月5日星期二 22:10
Tags:
VB代码 | 评论(0) | 引用(0) | 阅读(7675)
您也可用OpenID登入:
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]