windows doesn't keep a list of of activated windows only current
you can try this
or try
you can try this
int hwnd=RealGetNextWindow(0)
int x y
RECT r
;;top left
;;-----------
x=+1
y=+1
r.left=x; r.top=y
AdjustWindowPos hwnd &r 3
or try