hi guy,
can anybody help me, regarding an issue, i try to make a full screen transparent form and user can click on the desktop icons/shortcuts while the form is open, there's a lot of code for transparent but none corresponding to what i try to do
Printable View
hi guy,
can anybody help me, regarding an issue, i try to make a full screen transparent form and user can click on the desktop icons/shortcuts while the form is open, there's a lot of code for transparent but none corresponding to what i try to do
link got a sample exactly what u want, it has multiple cuts, u hav to modify to ur requirement.
I like this one
Code:Option Explicit
Private Declare Function SetWindowLongptr 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
'
' Constants for SetWindowLongptr
'
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
'
' Constants for SetLayeredWindowAttributes
'
Private Const LWA_ALPHA = &H2
Private Const LWA_COLORKEY = &H1
Dim BytAlpha As Byte, ColMsk As Long
Private Sub Command3_Click()
BytAlpha = BytAlpha - 1
SetWindowLongptr hWnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes hWnd, ColMsk, BytAlpha, LWA_COLORKEY Or LWA_ALPHA
End Sub
Private Sub Form_Load()
BytAlpha = 255 '190 '250
ColMsk = &HFF8888
Me.BackColor = ColMsk
SetWindowLongptr hWnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes hWnd, ColMsk, BytAlpha, LWA_COLORKEY Or LWA_ALPHA
End Sub
Private Sub Command1_Click()
MsgBox "Hello, All you can see are the two buttons"
End Sub
Private Sub Command2_Click()
If MsgBox("Do you want to quit?", vbYesNo) = vbYes Then
End
End If
End Sub
yes good one.