永发信息网

VB API很难解的一个问题!!求解

答案:1  悬赏:0  手机版
解决时间 2021-11-13 07:28
  • 提问者网友:战皆罪
  • 2021-11-13 00:26
VB API很难解的一个问题!!求解
最佳答案
  • 五星知识达人网友:刀戟声无边
  • 2021-11-13 01:24
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Sub Form_Load()
Dim Ret As Long
'Set the window style to 'Layered'
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
'Set the opacity of the layered window to 128
'我们可以设置这个数值来控制透明程度
SetLayeredWindowAttributes Me.hWnd, 0, 128, LWA_ALPHA
End Sub追问你知道API参数的含义吗???

你自己试试吧,和我说的第一种情况一样追答参数的含义MSDN中有介绍,自己看就是了追问- -

劳您大驾
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯