VB 窗口背景透明的方法
(2014-12-14 23:40:47)
标签:
股票 |
分类: VB |
VB 窗口背景透明的方法
━━━━━━━━━━━━━━━━━━━━━━━━━
PrivateDeclare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
PrivateDeclare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
PrivateDeclare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
PrivateDeclare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const WS_EX_LAYERED = & H80000
Const GWL_EX
>
Const LWA_ALPHA = & H2
Const LWA_COLORKEY = & H1
Const HWND_TOPMOST = -
1
Const SWP_NOMOVE = & H2
Const SWP_NOSIZE = & H1
PrivateSub Form_Load()
Form1.BackColor = RGB(1, 1, 1)
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE
rtn = GetWindowLong(hWnd, GWL_EXSTYLE)
rtn = rtn or WS_EX_LAYERED
SetWindowLong hWnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hWnd, RGB(1, 1, 1), 0, LWA_COLORKEY
EndSub
━━━━━━━━━━━━━━━━━━━━━━━━━
Private
Private
Private
Private
Const
Const
Const
Const
Const
Const
Const
Private
End
前一篇:迷语题目及答案