Jump to content
Sign in to follow this  

slider events

Recommended Posts


$NM_RELEASEDCAPTURE intercept when i relaes the mouse in a slider control.

How to intercept when i scroll the mouse over a silder control or when change the position?

Share this post

Link to post
Share on other sites

Try this example:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $iSlider, $hSlider, $iDumSlider


Func Example()
    Local $button, $msg

    GUICreate("slider", 220, 100)
    GUISetBkColor(0x00E0FFFF) ; will change background color

    $iSlider = GUICtrlCreateSlider(10, 10, 200, 20)
    GUICtrlSetLimit(-1, 200, 0) ; change min/max value
    GUICtrlSetCursor(-1, 0)
    GUICtrlSetState(-1, $GUI_FOCUS)

    $hSlider = GUICtrlGetHandle($iSlider)
    $iDumSlider = GUICtrlCreateDummy()

    $button = GUICtrlCreateButton("Value?", 75, 70, 70, 20)

    GUIRegisterMsg($WM_HSCROLL, "_GUIEvents")

    GUICtrlSetData($iSlider, 45) ; set pos

        $msg = GUIGetMsg()

        If $msg = $button Then
            MsgBox(0, "iSlider", GUICtrlRead($iSlider), 2)
    Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

Func _GUIEvents($hWnd, $iMsgID, $WParam, $LParam)
    #forceref $hWnd, $iMsgID, $wParam, $lParam

    Switch $iMsgID
        Case $WM_HSCROLL
            Switch $LParam
                Case $hSlider
                    GUICtrlSendToDummy($iDumSlider, GUICtrlRead($iSlider))
EndFunc   ;==>_GUIEvents


João Carlos.

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram


dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post

Link to post
Share on other sites

yes, but i used only GUIRegisterMsg($WM_HSCROLL, "_GUIEvents")

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.