Returns one of these values: LTRB (Left, Top, Right, Bottom)
On a multi-monitor setup, you may use WinGetPos or MouseGetPos or SysGet to find X and Y and pass it to TaskbarEdge()
The function
Code: Select all
TaskbarEdge( X:=0, Y:=0 ) { ; by SKAN on D39F/D39F @ tiny.cc/taskbaredge
Local hMonitor:=VarSetCapacity(var,84,0), v:=NumPut(40,var,"Int")-4
hMonitor := DllCall("MonitorFromPoint", "Int64",(X & 0xFFFFFFFF) | (Y << 32), "Int",0, "UPtr")
DllCall("GetMonitorInfo", "Ptr",hMonitor, "Ptr",v)
DllCall("GetWindowRect", "Ptr",WinExist("ahk_class Shell_SecondaryTrayWnd"), "Ptr",v+68)
DllCall("SubtractRect", "Ptr",v+52, "Ptr",v+4, "Ptr",v+68)
DllCall("GetWindowRect", "Ptr",WinExist("ahk_class Shell_TrayWnd"), "Ptr",v+36)
DllCall("SubtractRect", "Ptr",v+20, "Ptr",v+52, "Ptr",v+36)
Return NumGet(v+12,"Int")>NumGet(v+28,"Int") ? "R" : NumGet(v+16,"Int")>NumGet(v+32,"Int") ? "B"
: NumGet(v+20,"Int")>NumGet(v+4,"Int") ? "L" : NumGet(v+24,"Int")>NumGet(v+8,"Int") ? "T" : ""
}
The following is a customized version for ShowMenu()
Call example: ShowMenu( MenuGetHandle("Tray"), False, TrayMenuParams()* )
TrayMenuParams()