Code: Select all
UpdateLayeredWindow2(hwnd, hdc, x:="", y:="", w:="", h:="", Alpha:=255){
Ptr := (A_PtrSize == 8) ? "UPtr" : "UInt"
if ((x != "") && (y != ""))
VarSetCapacity(pt, 8), NumPut(x, pt, 0, "UInt"), NumPut(y, pt, 4, "UInt")
if ( w == "") || (h == "" )
WinGetPos ,, w, h, ahk_id %hwnd%
return UpdateLayeredWindow(hwnd
, 0
, ((x == "") && (y == "")) ? 0 : &pt
, w|h<<32
,hdc
, 0
, 0
, Alpha<<16|1<<24
, 2)
}
UpdateLayeredWindow3(hwnd, hdc, x:="", y:="", w:="", h:="", Alpha:=255){
Ptr := (A_PtrSize == 8) ? "UPtr" : "UInt"
if ((x != "") && (y != ""))
VarSetCapacity(pt, 8), NumPut(x, pt, 0, "UInt"), NumPut(y, pt, 4, "UInt")
if ( w == "") || (h == "" )
WinGetPos ,, w, h, ahk_id %hwnd%
return DllCall("UpdateLayeredWindow"
, Ptr, hwnd
, Ptr, 0
, Ptr, ((x == "") && (y == "")) ? 0 : &pt
, "int64*", w|h<<32
, Ptr, hdc
, "int64*", 0
, "uint", 0
, "UInt*", Alpha<<16|1<<24
, "uint", 2)
}