Code: Select all
#SingleInstance Force
#Include d:\utils\acc\Acc.ahk
CoordMode, Mouse
ControlGet, hWnd, Hwnd,, MSTaskListWClass1, ahk_class Shell_TrayWnd
For each, child in Acc_Children(oAcc := Acc_Get("Object", "tool bar", 0, "ahk_id " hWnd)) {
name := oAcc.accName(child), oRect := Acc_Location(oAcc, child)
If !oRect.x || name = ""
Continue
MouseMove, oRect.x, oRect.y
MsgBox, 262144,, % name ": " oRect.x " " oRect.x + oRect.w
}
OS version : 10.0.19043
CPU : Intel64 Family 6 Model 140 Stepping 1
OS bitness : 64
CPU bitness : 64
Display : Citrix Indirect Display Adapter
Display width : 1920
Display height : 1080
DPI : 144
AHK : 1.1.33.10
In this screenshot, Acc shows x = 270, but when the cursor is placed at x = 270, it is not the item's x-position.
It seems that even if the returned coordinates are relative to the taskbar itself or even the control, the numbers are wrong. I do notice that the taskbar items seem to elongate very briefly, so could the findings be related to how Windows compresses the button widths? Is there a way to resolve the problem and get the taskbar item dimensions shown on screen?