Sign in to follow this  
Followers 0
Ontosy

slider events

5 posts in this topic

$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

Example()

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)

    GUISetState()
    GUIRegisterMsg($WM_HSCROLL, "_GUIEvents")

    GUICtrlSetData($iSlider, 45) ; set pos

    Do
        $msg = GUIGetMsg()

        If $msg = $button Then
            MsgBox(0, "iSlider", GUICtrlRead($iSlider), 2)
        EndIf
    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))
            EndSwitch
    EndSwitch
EndFunc   ;==>_GUIEvents

Regards,

João Carlos.


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

Somewhere Out ThereJames Ingram

somewh10.png

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

Share this post


Link to post
Share on other sites

ty :)

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  
Followers 0