|
-
Mar 10th, 2007, 05:01 AM
#1
Thread Starter
Lively Member
[RESOLVED] see through clear windows invisible like vista please read
i found a thread yesterday that allowed a see through window that couldnt be clicked through. i then applied the code and modules to one of my own projects and this is where i get the problem.
1. the form has to be minimised and then maximised for it to be clickable (mmc player cd buttons etc)
2. when i click a transparent part i end up clicking what evers underneath
3. it takes an extra 30 secods (sometimes) to load
i would appreciate any help
thanx TANOVcomputers
also i still need help on this post if you would like to give me any help thank you
My System » Intel Pentium Dual Core T2330 @ 1.6GHz, Win7 Ultimate 32-bit, Office 07 Enterprise, Via AC'97 sound, 2048mb RAM, AutoIt, Adobe Master Collection CS4, VB6.

-
Mar 10th, 2007, 05:35 AM
#2
Re: see through clear windows invisible like vista please read
I faced the 'click-through' problem. See if this thread helps.
If you post the code you are using, perhaps we could help you better.
-
Mar 10th, 2007, 05:39 AM
#3
Thread Starter
Lively Member
Re: see through clear windows invisible like vista please read
ok ill get the code now and add it to this post
Code:
Private Sub Form_Load()
MMC.Command = "Open"
Label3.Caption = ""
Label5.Caption = ""
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim vbResponse As VbMsgBoxResult
vbResponse = MsgBox("Are You Sure You want to exit TANOV CD Player?", vbYesNo, " Exit Application")
Select Case vbResponse
Case vbYes
Unload Me
Case vbNo
Cancel = -1
End Select
End Sub
Private Sub MMC_StatusUpdate()
Label3.Caption = MMC.Track
Label5.Caption = MMC.Tracks
End Sub
Private Sub mnuFileBlack_Click()
Form1.BackColor = &H0&
Label1.BackColor = &H0&
Label2.BackColor = &H0&
Label3.BackColor = &H0&
Label4.BackColor = &H0&
Label5.BackColor = &H0&
Label1.ForeColor = &HFFFFFF
Label2.ForeColor = &HFFFFFF
Label3.ForeColor = &HFFFFFF
Label4.ForeColor = &HFFFFFF
Label5.ForeColor = &HFFFFFF
End Sub
Private Sub mnuFileBlue_Click()
Form1.BackColor = &H800000
Label1.BackColor = &H800000
Label2.BackColor = &H800000
Label3.BackColor = &H800000
Label4.BackColor = &H800000
Label5.BackColor = &H800000
Label1.ForeColor = &H80000012
Label2.ForeColor = &H80000012
Label3.ForeColor = &H80000012
Label4.ForeColor = &H80000012
Label5.ForeColor = &H80000012
End Sub
Private Sub mnuFiledefault_Click()
Me.BackColor = vbButtonFace
Label2.BackColor = Me.BackColor
Label1.BackColor = Me.BackColor
Label3.BackColor = Me.BackColor
Label4.BackColor = Me.BackColor
Label5.BackColor = Me.BackColor
Label1.ForeColor = &H80000012
Label2.ForeColor = &H80000012
Label3.ForeColor = &H80000012
Label4.ForeColor = &H80000012
Label5.ForeColor = &H80000012
End Sub
Private Sub mnuFileGrey_Click()
Form1.BackColor = &H8000000F
Label1.BackColor = &H8000000F
Label2.BackColor = &H8000000F
Label3.BackColor = &H8000000F
Label4.BackColor = &H8000000F
Label5.BackColor = &H8000000F
Label1.ForeColor = &H80000012
Label2.ForeColor = &H80000012
Label3.ForeColor = &H80000012
Label4.ForeColor = &H80000012
Label5.ForeColor = &H80000012
End Sub
Private Sub mnuFilePink_Click()
Form1.BackColor = &HFF00FF
Label1.BackColor = &HFF00FF
Label2.BackColor = &HFF00FF
Label3.BackColor = &HFF00FF
Label4.BackColor = &HFF00FF
Label5.BackColor = &HFF00FF
Label1.ForeColor = &H80000012
Label2.ForeColor = &H80000012
Label3.ForeColor = &H80000012
Label4.ForeColor = &H80000012
Label5.ForeColor = &H80000012
End Sub
thats the form code
now for the module
!!!THAT POST YOU GAVE ME WAS THE ONE I FOUND YESTERDAY AND I CANT GET IT TO WORK!!!
Code:
Option Explicit
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI
X As Long
Y As Long
End Type
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Public 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 Declare Function GetWindowRect Lib "user32" ( _
ByVal hwnd As Long, _
lpRect As RECT) As Long
Private Declare Function ClientToScreen Lib "user32" ( _
ByVal hwnd As Long, _
lpPoint As POINTAPI) As Long
Private Declare Function GetWindow Lib "user32" ( _
ByVal hwnd As Long, _
ByVal wCmd As Long) As Long
Public Const GWL_STYLE = (-16)
Public Const WS_SYSMENU = &H80000
Public Const WS_MINIMIZEBOX = &H20000
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
Private Const GW_HWNDNEXT = 2
Public Sub SetTrans(oForm As Form, Optional bytAlpha As Byte = 255, Optional lColor As Long = 0)
Dim lStyle As Long
lStyle = GetWindowLong(oForm.hwnd, GWL_EXSTYLE)
If Not (lStyle And WS_EX_LAYERED) = WS_EX_LAYERED Then _
SetWindowLong oForm.hwnd, GWL_EXSTYLE, lStyle Or WS_EX_LAYERED
SetLayeredWindowAttributes oForm.hwnd, lColor, bytAlpha, LWA_COLORKEY Or LWA_ALPHA
End Sub
Public Function IsOverCtl(oForm As Form, ByVal X As Long, ByVal Y As Long) As Boolean
Dim ctl As Control, lhWnd As Long, r As RECT, pt As POINTAPI
pt.X = X: pt.Y = Y
ClientToScreen oForm.hwnd, pt
For Each ctl In oForm.Controls
On Error GoTo ErrHandler
lhWnd = ctl.hwnd
On Error GoTo 0
If lhWnd Then
GetWindowRect ctl.hwnd, r
IsOverCtl = (pt.X >= r.Left And pt.X <= r.Right And pt.Y >= r.Top And pt.Y <= r.Bottom)
If IsOverCtl Then Exit Function
End If
Next ctl
Exit Function
ErrHandler:
lhWnd = 0
Resume Next
End Function
Public Function GetNextWindow(ByVal lhWnd As Long) As Long
GetNextWindow = GetWindow(lhWnd, GW_HWNDNEXT)
End Function
ANY HELP???
Last edited by TANOVcomputers; Mar 10th, 2007 at 05:44 AM.
My System » Intel Pentium Dual Core T2330 @ 1.6GHz, Win7 Ultimate 32-bit, Office 07 Enterprise, Via AC'97 sound, 2048mb RAM, AutoIt, Adobe Master Collection CS4, VB6.

-
Mar 10th, 2007, 04:50 PM
#4
Thread Starter
Lively Member
Re: see through clear windows invisible like vista please read
i sussed it...
right for those who wish to no go to the post that iPrank tels us about and download the glass one.
All you need to do to stop clicks going behind is make a label with no caption, send it to back and make it transparent. Make it full size and make its click code and make it <form name>.Show now when you click it just shows the form
My System » Intel Pentium Dual Core T2330 @ 1.6GHz, Win7 Ultimate 32-bit, Office 07 Enterprise, Via AC'97 sound, 2048mb RAM, AutoIt, Adobe Master Collection CS4, VB6.

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
|