I'm using the following code to make a vb.net form click through and transparent:
Dim InitialStyle As Integer
'Dim PercentVisible As Decimal
InitialStyle = GetWindowLong(Me.Handle, -20)
'PercentVisible = 0.4
SetWindowLong(Me.Handle, -20, InitialStyle Or &H80000 Or &H20)
'SetLayeredWindowAttributes(Me.Handle, 0, 255 * PercentVisible, &H2)
Me.BackColor = System.Drawing.Color.LightBlue
Me.TransparencyKey = System.Drawing.Color.LightBlue
Me.TopMost = True
it does work on my development machine (windows 10). It does work on a VM guest windows 7 (on the same host). It does not work (the form is not click through) in a laptop with windows 7 service pack 1, it does not work in another computer with windows 7 and it does not work in a laptop with windows 10 home edition. the pc where it works has 64bit OS, the same where it does not. But also does not on some 32bit
What is the problem here? Is there a way to fix this issue? Thank you in advance.
P.S. I have commented out the SetLayeredWindowAttributes
because it's not needed to make it transparent (even with it enabled, does not affect it).