getttpos

Gets the show state, position and size of the terminal window.

Format

getttpos <showflag> <window x> <window y> <window width> <window height> <client x> <client y> <client width> <client height>

Parameters

Integer variable <showflag>
The display status of the terminal window is stored.
0 : Normal
1 : Minimized (Iconified)
2 : Maximized
3 : Hidden
Integer variable <window x>
The X coordinate of the top-left corner of the window area is stored.
Integer variable <window y>
The Y coordinate of the top-left corner of the window area is stored.
Integer variable <window width>
The width of the window area is stored.
Integer variable <window height>
The height of the window area is stored.
Integer variable <client x>
The X coordinate of the top-left corner of the client area is stored.
Integer variable <client y>
The Y coordinate of the top-left corner of the client area is stored.
Integer variable <client width>
The width of the client area is stored.
Integer variable <client height>
The height of the client area is stored.

Return Value

System variable <result>
If the information retrieval is successful, the value 0 is stored.
If it fails, the value -1 is stored.

Remarks

The units for coordinates, width, and height are points (on a Retina display, a point is not the same as a pixel).
X is measured from the left edge of the main display. Y is measured downward from the top edge of the screen the window is on.
The window area refers to the entire window, while the client area refers to the text display area excluding the title bar etc. from the window area.
If the window is in a minimized or hidden state, the stored values for coordinates, width, and height are incorrect.
If the macro is not linked to a window, it will result in a macro error and the execution of the macro will be temporarily paused.

Example

testlink
if result > 0 then
  :start
  getttpos showflag w_x w_y w_width w_height c_x c_y c_width c_height
  if showflag != 3 then
    if showflag = 1 then
      showtt 1
      goto start
    endif
    setdlgpos c_x c_y
    sprintf2 str 'x=%d, y=%d, width=%d, height=%d' c_x c_y c_width c_height
    messagebox str 'Client Area'
  endif
endif

See also