Jump to content

My First Script: Translucent Form


the DtTvB
 Share

Recommended Posts

This is my first AutoIt script. From my knowledge of VB.

Here is the function, you can place somewhere in your code.

Func SetOpacity($hwnd, $opacity)
    Dim $a
    $a = DllCall("user32.dll", "long", "GetWindowLongA", "hwnd", $hwnd, "long", -20)
    DllCall("user32.dll", "long", "SetWindowLongA", "hwnd", $hwnd, "long", -20, "long", BitOR($a, 524288))
    DllCall("user32.dll", "long", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", 0, "long", $opacity, "long", 2)
EndFunc

Usage: SetOpacity ($hwnd, $opacity)

$hwnd - Hwnd of target window

$opacity - Opacity value in the scale of 0-255

Full Script:

transparent.au3 (Makes a translucent window.)

fade.au3 (Fades form in, and out.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...