Here's the code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As Long, ByVal | |
crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Boolean | |
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 GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, | |
ByVal nIndex As Long) As Long | |
Const LWA_ALPHA = 2 | |
Const GWL_EXSTYLE = (-20) | |
Const WS_EX_LAYERED = &H80000 | |
Private Sub Form_Load() | |
SetWindowLong hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED | |
SetLayeredWindowAttributes hwnd, 0, 128, LWA_ALPHA | |
End Sub |
Komentar