I'm trying to convert it to work with v2, but I don't understand enough of the new commands yet.
Can someone help? I've looked at a few libraries on the forum & github, but it was too complex for me to understand and extract just this part that I need.
Code: Select all
SetTaskbarProgress(State := "", Value := "", Hwnd := "") {
Static TBL := ""
If (TBL = "") {
TBL := ComObjCreate("{56FDF344-FD6D-11D0-958A-006097C9A090}", "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}")
}
State := (State = "I" ? 1 : State = "N" ? 2 : State = "E" ? 4 : State = "P" ? 8 : 0)
Hwnd := (Hwnd = "" ? WinExist() : Hwnd)
DllCall(NumGet(NumGet(TBL + 0) + 10 * A_PtrSize), "Ptr", TBL, "Ptr", Hwnd, "UInt", State)
If (Value != "") {
DllCall(NumGet(NumGet(TBL + 0) + 9 * A_PtrSize), "Ptr", TBL, "Ptr", Hwnd, "Int64", Value, "Int64", 100)
}
return (TBL ? 0 : 1)
}