Option Explicit'在窗口结构中为指定的窗口设置信息 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 Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Private Const WS_EX_LAYERED = &H80000 Private Const GWL_EXSTYLE = (-20) Private Const LWA_ALPHA = &H2 Private Const LWA_COLORKEY = &H1 ' Private Sub Form_Load() Dim ret As Long ret = GetWindowLong(Me.hwnd, GWL_EXSTYLE) If ret = 0 Then Debug.Print "error" SetWindowLong Me.hwnd, GWL_EXSTYLE, ret Or WS_EX_LAYERED SetLayeredWindowAttributes hwnd, 0, 200, LWA_ALPHA End Sub白接分也不好意思
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 Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2
Private Const LWA_COLORKEY = &H1
'
Private Sub Form_Load()
Dim ret As Long
ret = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
If ret = 0 Then Debug.Print "error"
SetWindowLong Me.hwnd, GWL_EXSTYLE, ret Or WS_EX_LAYERED
SetLayeredWindowAttributes hwnd, 0, 200, LWA_ALPHA
End Sub白接分也不好意思
难道你能指望二战时期有人认得现在的欧元?
在这里,我要特别感谢tiger_zhao长期给予我的帮助。
准备结贴时,发现您的帖子无法加分,查看一下是什么原因。