Anchor(ctrl, a, draw = false) { ; v3.2 by Titan static pos sig = `n%A_Gui%:%ctrl%= If !InStr(pos, sig) { GuiControlGet, p, Pos, %ctrl% pos := pos . sig . px - A_GuiWidth . "/" . pw - A_GuiWidth . "/" . py - A_GuiHeight . "/" . ph - A_GuiHeight . "/" } StringTrimLeft, p, pos, InStr(pos, sig) - 1 + StrLen(sig) StringSplit, p, p, / c = xwyh Loop, Parse, c If InStr(a, A_LoopField) { If A_Index < 3 e := p%A_Index% + A_GuiWidth Else e := p%A_Index% + A_GuiHeight m = %m%%A_LoopField%%e% } If draw d = Draw GuiControl, Move%d%, %ctrl%, %m% }