VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Translucent Windows Simpler

by Marcelo Ferreira (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

Creates a translucent window. No DLL/OCX, No flick, No Static, No headache !!
You create a new form, copy and paste into General Declarations section, and [F5]... " Já foi pra conta!" It's done...
<https://support.microsoft.com/default.aspx?scid=kb;EN-US;q249341>>

Rate Translucent Windows Simpler

Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private 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 crey As Byte, ByVal bAlpha As Byte, _
 ByVal dwFlags As Long) As Long
Private Const Estilo = (-20)
Private Const Camada = &H80000
Private Const CorAlpha = &H2&
'-------------------
Private Sub Form_Load()
  Dim AntigoEstilo As Long
  Dim Nivel As Byte ' Transparency (0 - 255)
  Nivel = 180
  AntigoEstilo = GetWindowLong(Me.hwnd, Estilo)
  SetWindowLong Me.hwnd, Estilo, AntigoEstilo Or Camada
  SetLayeredWindowAttributes Me.hwnd, 0, Nivel, CorAlpha
End Sub

Download this snippet    Add to My Saved Code

Translucent Windows Simpler Comments

No comments have been posted about Translucent Windows Simpler. Why not be the first to post a comment about Translucent Windows Simpler.

Post your comment

Subject:
Message:
0/1000 characters