|
-
Jun 11th, 2011, 08:09 AM
#1
Thread Starter
Addicted Member
Transparent form
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
-
Jun 11th, 2011, 08:43 AM
#2
Re: Transparent form
link got a sample exactly what u want, it has multiple cuts, u hav to modify to ur requirement.
-
Jun 11th, 2011, 03:59 PM
#3
Re: Transparent form
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
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jun 11th, 2011, 08:56 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|