get_window_extentsT_get_window_extentsGetWindowExtentsGetWindowExtentsget_window_extents (算子)
名称
get_window_extentsT_get_window_extentsGetWindowExtentsGetWindowExtentsget_window_extents — 有关窗口大小和位置的信息。
签名
def get_window_extents(window_handle: HHandle) -> Tuple[int, int, int, int]
描述
get_window_extentsget_window_extentsGetWindowExtentsGetWindowExtentsGetWindowExtentsget_window_extents returns the position of the upper left
corner, as well as width and height of the output window.
注意
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_extentsGetWindowExtentsGetWindowExtentsGetWindowExtentsget_window_extents may change cause of side effects.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (输入控制) window → HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
窗口句柄。
RowRowRowRowrowrow (输出控制) rectangle.origin.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Row index of upper left corner of the window.
ColumnColumnColumnColumncolumncolumn (输出控制) rectangle.origin.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Column index of upper left corner of the window.
WidthWidthWidthWidthwidthwidth (输出控制) rectangle.extent.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Window width.
HeightHeightHeightHeightheightheight (输出控制) rectangle.extent.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Window height.
示例(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);
示例(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)
示例(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)
示例(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)
结果
If the window is valid get_window_extentsget_window_extentsGetWindowExtentsGetWindowExtentsGetWindowExtentsget_window_extents 返回 2 ( H_MSG_TRUE )。如有必要,则抛出异常。
可能的前趋
open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window,
set_drawset_drawSetDrawSetDrawSetDrawset_draw,
set_colorset_colorSetColorSetColorSetColorset_color,
set_coloredset_coloredSetColoredSetColoredSetColoredset_colored,
set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidthset_line_width
另见
set_window_extentsset_window_extentsSetWindowExtentsSetWindowExtentsSetWindowExtentsset_window_extents,
open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window
模块
基础