The UpdateLayeredWindow function uses WINAPI

Ask for help, how to use AHK_H, etc.
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

The UpdateLayeredWindow function uses WINAPI

05 Jul 2017, 15:18

I try to use WINAPI to modify GDIP.AHK, only this function, UpdateLayeredWindow, can not be normal conversion. How should it be modified?

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)
}
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: The UpdateLayeredWindow function uses WINAPI

05 Jul 2017, 17:06

Try if this works:

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
                , getvar(temp1:=w|h<<32)
                ,hdc
                , getvar(temp2:=0)
                ,  0
                , getvar(temp3:=Alpha<<16|1<<24)
                , 2)
}

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 23 guests