HALCON Reference Manual 10.0.2
Table of Contents / Graphics / Window ClassesClassesClasses | | | Operators

get_window_extentsget_window_extentsget_window_extentsGetWindowExtentsGetWindowExtents (Operator)

Name

get_window_extentsget_window_extentsget_window_extentsGetWindowExtentsGetWindowExtents — Information about a window's size and position.

Signature

get_window_extents( : : WindowHandle : Row, Column, Width, Height)

Herror get_window_extents(const Hlong WindowHandle, Hlong* Row, Hlong* Column, Hlong* Width, Hlong* Height)

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

Herror get_window_extents(const HTuple& WindowHandle, Hlong* Row, Hlong* Column, Hlong* Width, Hlong* Height)

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

void HOperatorSetX.GetWindowExtents(
[in] VARIANT WindowHandle, [out] VARIANT* Row, [out] VARIANT* Column, [out] VARIANT* Width, [out] VARIANT* Height)

Hlong HWindowX.GetWindowExtents(
[out] Hlong* Column, [out] Hlong* Width, [out] Hlong* Height)

static void HOperatorSet.GetWindowExtents(HTuple windowHandle, out HTuple row, out HTuple column, out HTuple width, out HTuple height)

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

Description

get_window_extentsget_window_extentsget_window_extentsGetWindowExtentsGetWindowExtents 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_extentsget_window_extentsget_window_extentsGetWindowExtentsGetWindowExtents may change cause of side effects.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Window identifier.

RowRowRowRowrow (output_control)  rectangle.origin.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Row index of upper left corner of the window.

ColumnColumnColumnColumncolumn (output_control)  rectangle.origin.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Column index of upper left corner of the window.

WidthWidthWidthWidthwidth (output_control)  rectangle.extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Window width.

HeightHeightHeightHeightheight (output_control)  rectangle.extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (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)

Example (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) ;

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)

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)

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)

Result

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

Possible Predecessors

open_windowopen_windowopen_windowOpenWindowOpenWindow, set_drawset_drawset_drawSetDrawSetDraw, set_colorset_colorset_colorSetColorSetColor, set_coloredset_coloredset_coloredSetColoredSetColored, set_line_widthset_line_widthset_line_widthSetLineWidthSetLineWidth, open_textwindowopen_textwindowopen_textwindowOpenTextwindowOpenTextwindow

See also

set_window_extentsset_window_extentsset_window_extentsSetWindowExtentsSetWindowExtents, open_windowopen_windowopen_windowOpenWindowOpenWindow, open_textwindowopen_textwindowopen_textwindowOpenTextwindowOpenTextwindow

Module

Foundation


Table of Contents / Graphics / Window ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH