ControlGetPos

提供: AutoHotkey Wiki
移動: 案内検索

実行制御 | GUI表示 | 演算・変数 | メモリ・DLL操作 | 文字列操作 | キーボード | マウス | シェル | ウィンドウ | ウィンドウグループ
ステータスバー | コントロール | サウンド | ファイル | INIファイル | レジストリ | 環境変数 | AutoHotkey | その他 | 設定関係 | オブジェクト

ControlGetPos[編集]

コントロールの位置とサイズを取得。

ControlGetPos [, X, Y, Width, Height, Control, WinTitle, WinText, ExcludeTitle, ExcludeText] 

Parameters[編集]

引数名 説明
X, Y X座標とY座標を格納する変数名。
親ウィンドウの左上からの位置になる。
取得失敗時は空になる。
Width/Height 横幅と高さを格納する変数名
Control コントロールを指定。
ウィンドウ指定の方法参照。
WinTitle ウィンドウタイトルなど。
ウィンドウ指定の方法参照。
WinText ウィンドウに含まれるテキスト
ExcludeTitle 除外タイトル
ExcludeText 除外テキスト

Related[編集]

ControlMove, WinGetPos, Control, ControlGet, ControlGetText, ControlSetText, ControlClick, ControlFocus, ControlSend

Example(s)[編集]

; This working example will continuously update and display the
; name and position of the control currently under the mouse cursor:
Loop
{
  Sleep, 100
  MouseGetPos, , , WhichWindow, WhichControl
  ControlGetPos, x, y, w, h, %WhichControl%, ahk_id %WhichWindow%
  ToolTip, %WhichControl%`nX%X%`tY%Y%`nW%W%`t%H%
}