Function Reference


_GUICtrlSlider_GetChannelRect

Retrieves the size and position of the bounding rectangle for a sliders's channel

#include <GuiSlider.au3>
_GUICtrlSlider_GetChannelRect ( $hWnd )

Parameters

$hWnd Control ID/Handle to the control

Return Value

Returns an array in the following format:
    [0] - X coordinate of the upper left corner of the rectangle
    [1] - Y coordinate of the upper left corner of the rectangle
    [2] - X coordinate of the lower right corner of the rectangle
    [3] - Y coordinate of the lower right corner of the rectangle

Related

_GUICtrlSlider_GetChannelRectEx

Example

#include <GUIConstantsEx.au3>
#include <GuiSlider.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
        Local $aRect, $idSlider

        ; Create GUI
        GUICreate("Slider Get Channel Rect", 400, 296)
        $idSlider = GUICtrlCreateSlider(2, 2, 396, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE))
        GUISetState(@SW_SHOW)

        ; Get Channel Rect
        $aRect = _GUICtrlSlider_GetChannelRect($idSlider)

        MsgBox($MB_SYSTEMMODAL, "Information", StringFormat("[%d][%d][%d][%d]", $aRect[0], $aRect[1], $aRect[2], $aRect[3]))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
EndFunc   ;==>Example