我弄了个窗体透明,但是会穿透的,请大神看下怎么使窗体透明而又不穿透。
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As longPrivate 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()
Me.BackColor = &HF0000
Dim r As Long
BorderStyler = 0
r = GetWindowLong(hwnd, -20)
r = r Or &H80000
SetWindowLong hwnd, -20, r
SetLayeredWindowAttributes hwnd, &HFF0000, 0, &H1