Jump to content

Recommended Posts

Posted (edited)
19 minutes ago, Nine said:

Just use my UDF. I am not going to help trimming down my code to fit your needs.  If you cant figure out from my code, I guess continue with your own...

Understood :) thanks anyways!

So far I had this unfinished draft:

Global $hScrollProc

Func CreateCustomScrollbar()
    $hScrollProc = DllCallbackRegister(ScrollBarProc, 'lresult', 'hwnd;uint;wparam;lparam;uint_ptr;dword_ptr')
    _WinAPI_SetWindowSubclass(GUICtrlGetHandle($minimark_thumblabel), DllCallbackGetPtr($hScrollProc), 0, 0)
EndFunc

Func ScrollBarProc($hWnd, $iMsg, $wParam, $lParam, $iID, $iData)
    If $iMsg <> $WM_LBUTTONDOWN Then Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam)

    Local $iYStart = MouseGetPos(1)
    Local $aEditPos = ControlGetPos("[ACTIVE]", "", $minimark_edit)
    Local $iScrollRange = _GUICtrlEdit_GetLineCount($minimark_edit)

    While _IsPressed("01")
        Local $iYCurrent = MouseGetPos(1)
        If $iYStart <> $iYCurrent Then
            Local $iNewPos = ($iYCurrent - $aEditPos[1]) * 100 / $iScrollRange
            _GUICtrlEdit_Scroll($minimark_edit, $iNewPos)
        EndIf
    WEnd

    Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam)
EndFunc

But I have a lot to learn when it comes to the low level magic in your code, your UDF is fasinating :D

Edited by TheAutomator

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...