Skip to content

get_window_extentsGetWindowExtentsGetWindowExtentsget_window_extentsT_get_window_extentsπŸ”—

Short descriptionπŸ”—

get_window_extentsGetWindowExtentsGetWindowExtentsget_window_extentsT_get_window_extents β€” Information about a window’s size and position.

SignatureπŸ”—

get_window_extents( window WindowHandle, out rectangle.origin.y Row, out rectangle.origin.x Column, out rectangle.extent.x Width, out rectangle.extent.y Height )void GetWindowExtents( const HTuple& WindowHandle, HTuple* Row, HTuple* Column, HTuple* Width, HTuple* Height )static void HOperatorSet.GetWindowExtents( HTuple windowHandle, out HTuple row, out HTuple column, out HTuple width, out HTuple height )def get_window_extents( window_handle: HHandle ) -> Tuple[int, int, int, int]

Herror T_get_window_extents( const Htuple WindowHandle, Htuple* Row, Htuple* Column, Htuple* Width, Htuple* Height )

void HWindow::GetWindowExtents( Hlong* Row, Hlong* Column, Hlong* Width, Hlong* Height ) const

void HWindow.GetWindowExtents( out int row, out int column, out int width, out int height )

DescriptionπŸ”—

get_window_extentsGetWindowExtents returns the position of the upper left corner, as well as width and height of the output window.

AttentionπŸ”—

Size and position of a window may be modified by the window manager, without explicit instruction in the program. Therefore the values which are returned by get_window_extentsGetWindowExtents may change cause of side effects.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

WindowHandlewindowHandlewindow_handle (input_control) window β†’ (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

Rowrowrow (output_control) rectangle.origin.y β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Row index of upper left corner of the window.

Columncolumncolumn (output_control) rectangle.origin.x β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Column index of upper left corner of the window.

Widthwidthwidth (output_control) rectangle.extent.x β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Window width.

Heightheightheight (output_control) rectangle.extent.y β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Window height.

ExampleπŸ”—

(HDevelop)

open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)
(C)
open_window(100,100,200,200,"root","visible","",&WindowHandle)\;
fwrite_string(FileHandle,"Move the window with the mouse!")\;
fnew_line(FileHandle)\;
create_tuple(&String,1)\;
do
{
  get_mbutton(WindowHandle,NULL,NULL,&Button)\;
  get_window_extents(WindowHandle,&Row,&Column,&Width,&Height)\;
  sprintf(buf,"Row %d Col %d ",Row,Column)\;
  set_s(String,buf,0)\;
  T_fwrite_string(FileHandle, String)\;
  fnew_line(FileHandle)\;
}
while(Button < 4)\;

ResultπŸ”—

If the window is valid get_window_extentsGetWindowExtents returns 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

open_windowOpenWindow, set_drawSetDraw, set_colorSetColor, set_coloredSetColored, set_line_widthSetLineWidth

See also

set_window_extentsSetWindowExtents, open_windowOpenWindow

ModuleπŸ”—

Foundation