get_window_extents -关于窗口大小和位置的信息
简短描述
get_window_extents -关于窗口大小和位置的信息。
签名
get_window_extents( : : WindowHandle : Row, Column, Width, Height)
描述
Get_window_extents返回左上角的位置,以及输出窗口的宽度和高度
注意
窗口的大小和位置可以由窗口管理器修改,而不需要在程序中进行显式指示。因此get_window_extents返回的值的变化可能导致的副作用。
参数
window (输入参数)→(integer)
窗口句柄。
Row (输出参数) rectangle.origin.y→(integer)
窗口左上角的行索引。
列(输出参数 ) rectangle.origin.x→(integer)
窗口左上角的列索引。
Width (输出参数 ) rectangle.extent.x→(integer)
窗口的宽度。
Height (输出参数 ) rectangle.extent.y→(integer)
窗口的高度。
例程
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)
返回结果
如果窗口有效get_window_extents返回2 (H_MSG_TRUE)。如果有必要会抛出一个异常。


微信扫一扫,打赏作者吧~