Function Reference

_GUICtrlSlider_GetThumbRect

スライダーの外接長方形のサイズと位置を取得します。

#Include <GuiSlider.au3>
_GUICtrlSlider_GetThumbRect($hWnd)

 

パラメータ

$hWnd コントロールのハンドル

 

返し値

成功: 次のフォーマットの配列:
    [0] - 長方形の左上隅のX座標
    [1] - 長方形の左上隅のY座標
    [2] - 長方形の右下隅のX座標
    [3] - 長方形の右下隅のY座標

 

注意

なし。

 

関連

_GUICtrlSlider_GetThumbRectEx

 


#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiSlider.au3>

Opt('MustDeclareVars', 1)

$Debug_S = False ; 関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用

_Main()

Func _Main()
    Local $aRect, $hSlider

    ; GUIを作成
    GUICreate("Slider Get Thumb Rect", 400, 296)
    $hSlider = GUICtrlCreateSlider(2, 2, 396, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE))
    GUISetState()

    ; つまみ長方形を取得
    $aRect = _GUICtrlSlider_GetThumbRect($hSlider)
   
    MsgBox(4160, "Information", StringFormat("[%d][%d][%d][%d]", $aRect[0], $aRect[1], $aRect[2], $aRect[3]))

    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main