window.getPosition

Syntax window.getPosition (title, horizAddr, vertAddr)

Params title is the name of a window.

horizAddr is the Object Database location where you wish the window's horizontal coordinate position stored.

vertAddr is the Object Database location where you wish the window's vertical coordinate position stored.

Action Retrieves and stores the position of a window.

Returns True if the window is open and horizAddr and vertAddr are set; false otherwise.

Examples window.getPosition (window.frontMost (), @h, @v);
msg (h + ", " + v)

   » 127,214

The return value "127,214," or something like it, displays in Frontier's Main Window.

window.getPosition (window.next (window.frontmost ()), @h, @v);
msg (h + ", " + v)

   » 689,34

The return value "689,34," or something like it, displays in Frontier's About Window - this system obviously has a big screen or a second monitor!

Close all windows except the Quick Script window and (of course) the Main Window, which cannot be closed as long as Frontier is running. Now type and execute:
window.getPosition (window.frontMost (), @h, @v);

msg (h + ", " + v)


   » 689,34

The return value displays in the Main Window.

Move the Quick Script window and execute the same line. The result is the same. When all other windows are closed, the frontmost window is the Main Window. Move it and then execute the same line and you will see that the return value changes.

See Also window.setPosition

window.getSize

Discuss