VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Alphablended (Transparent) Windows

Michael Barnathan  (11 Submissions)   Graphics   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

This code will demonstrate how to create a window with partial transparency. The color of the window and the amount of transparency (in percent, from 0 to 100% transparent) are customizable. The code involves no screen capturing, it is actually an alphablended window. The window contents update in realtime as the window is moved, sized, or manipulated in any way. This only works in Windows 2000/XP.

Assumes
This code only works in Windows 2000 or Windows XP. Expect all new versions of windows that come out to support this later on.

API Declarations
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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

Rate Alphablended (Transparent) Windows (11(11 Vote))

Download Alphablended (Transparent) Windows

Alphablended (Transparent) Windows Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters