Jump to content

Recommended Posts

Posted

I asked this question back in >December 2012 and just stumbled across the answer when I was looking at monitoring when a titlebar text changes. Funny how things seem so simple when you know how.

#include <ScrollbarConstants.au3>
#include <WinAPISys.au3>

Global $hEventProc = DllCallbackRegister('_EventProc', 'none', 'ptr;dword;hwnd;long;long;dword;dword')
Global $hEventHook = _WinAPI_SetWinEventHook($EVENT_OBJECT_VALUECHANGE, $EVENT_OBJECT_VALUECHANGE, DllCallbackGetPtr($hEventProc), ProcessExists('SciTE.exe'))
Global $hSciTEEdit = ControlGetHandle(WinGetHandle('[CLASS:SciTEWindow]'), '', '[CLASS:Scintilla; INSTANCE:1]')

Sleep(10000)

Func OnAutoItExit()
    _WinAPI_UnhookWinEvent($hEventHook)
    DllCallbackFree($hEventProc)
EndFunc   ;==>OnAutoItExit

Func _EventProc($hEventHook, $iEvent, $hWnd, $iObjectID, $iChildID, $iThreadID, $iEventTime)
    #forceref $hEventHook, $iObjectID, $iChildID, $iThreadID, $iEventTime

    ; http://msdn.microsoft.com/en-us/library/windows/desktop/dd373606(v=vs.85).aspx
    If $hWnd = $hSciTEEdit And $iObjectID = $OBJID_VSCROLL Then ; Monitor only if the hWnd matches the SciTE edit handle and the object id is a vertical scrollbar.
        Switch $iEvent
            Case $EVENT_OBJECT_VALUECHANGE
                ConsoleWrite('SciTE scrollbar move.' & @CRLF)

        EndSwitch
    EndIf
EndFunc   ;==>_EventProc

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

No problems. Sharing is caring in my book.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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...