Function Reference


_GUICtrlSlider_GetBuddy

Retrieves the handle to a slider control buddy window at a given location

#include <GuiSlider.au3>
_GUICtrlSlider_GetBuddy ( $hWnd, $bLocation )

Parameters

$hWnd Control ID/Handle to the control
$bLocation Which buddy window handle will be retrieved. This value can be one of the following:
    True - Retrieves the handle to the buddy to the left of the slider.
        If the slider control uses the $TBS_VERT style, the message will retrieve the buddy above the slider.
    False - Retrieves the handle to the buddy to the right of the slider.
        If the slider control uses the $TBS_VERT style, the message will retrieve the buddy below the slider.

Return Value

Success: the handle to the buddy window at the location specified by $bLocation.
Failure: 0.

Related

_GUICtrlSlider_SetBuddy

Example

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

Example()

Func Example()
        ; Create GUI
        GUICreate("Slider Get/Set Buddy (v" & @AutoItVersion & ")", 400, 296)
        Local $idSlider = GUICtrlCreateSlider(95, 2, 205, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE))
        Local $idInput = GUICtrlCreateInput("0", 2, 25, 90, 20)
        Local $idInput2 = GUICtrlCreateInput("0", 2, 25, 90, 20)
        GUISetState(@SW_SHOW)

        ; Set buddy to left
        _GUICtrlSlider_SetBuddy($idSlider, True, $idInput)
        ; Set buddy to right
        _GUICtrlSlider_SetBuddy($idSlider, False, $idInput2)

        ; Get Buddy from the left
        MsgBox($MB_SYSTEMMODAL, "Information", "Buddy Handle: " & _GUICtrlSlider_GetBuddy($idSlider, True))

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