TJF

WIN 10 Tablet - asynchronous scroll bar

1 post in this topic

Hi,

 

I have a sroll area and a scroll bar. At PC everything works fine: If I scroll the bar or if I use the mousewheel. But on a WIN 10 tablet it is working only correct, if I use the scroll bar with the finger. Using the finger at the scroll area, everything is asynchronous. Any idea? -> attached Scroll.zip

 

Regards

Thomas

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>
#include <ListViewConstants.au3>
#include <SendMessage.au3>
#include "GuiScroll.au3" ; -> http://autoit.de/index.php?page=Thread&postID=162464#post162464

startGui()

Func startGui()
    $Gui = GUICreate("", 700, 600, -1, -1, $WS_POPUP)
    $up = GUICtrlCreateButton("UP", 10, 10, 80, 40)
    $down = GUICtrlCreateButton("DOWN", 100, 10, 80, 40)
    GUICtrlCreateLabel("Schliessen mit ESC", 550, 10, 120, 40)
    GUIRegisterMsg($WM_MOUSEWHEEL, "_Scrollbars_WM_MOUSEWHEEL")
    $hScrollPl = GUICreate("$hScrollPl", 500, 400, 10, 100, BitOR($WS_POPUP, $WS_GROUP, $WM_VSCROLL, $WS_CLIPSIBLINGS), $WS_EX_MDICHILD, $Gui)
    GUISetBkColor(0xffffff)
    Scrollbar_Create($hScrollPl, $SB_VERT, 400)
    Scrollbar_Step(10, $hScrollPl, $SB_VERT)
    _GUIScrollBars_SetScrollInfoMax($hScrollPl, $SB_VERT, 500)

    $art = GUICtrlCreateLabel("", 1, 1) ; Label für folgenden Focus...

    $hListV = GUICtrlCreateListView("1|2", 100, 100, 300, 200, BitOR($LVS_REPORT, $LVS_NOCOLUMNHEADER, $LVS_SHOWSELALWAYS))
    GUISetState(@SW_SHOW, $Gui)
    GUISetState(@SW_SHOW, $hScrollPl)
    GUICtrlSetState($art, $GUI_FOCUS); Focus auf Label von $hScrollPl
    GUISwitch($Gui)
    ;GUISetState(@SW_SHOW, $Gui)
    While 1
        $iMsg3 = GUIGetMsg()
        Switch $iMsg3
            Case $GUI_EVENT_CLOSE
                Exit
            Case $up
                MsgBox(0, "Info", "Button up gedrückt")
                GUICtrlSetState($art, $GUI_FOCUS); Focus auf Label von $hScrollPl
            Case $down
                MsgBox(0, "Info", "Button down gedrückt")
                GUICtrlSetState($art, $GUI_FOCUS); Focus auf Label von $hScrollPl
        EndSwitch
    WEnd
EndFunc   ;==>startGui

Func _Scrollbars_WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $lParam
    Local $i, $iDirn, $iDelta = BitShift($wParam, 16) ; Mouse wheel movement

    If BitAND($wParam, 0x0000FFFF) Then ; If Ctrl or Shft pressed move Horz scrollbar
        $iDirn = $SB_LINERIGHT
        If $iDelta > 0 Then $iDirn = $SB_LINELEFT
        For $i = 1 To 7
            _SendMessage($hWnd, $WM_HSCROLL, $iDirn)
        Next
    Else ; Move Vert scrollbar
        $iDirn = $SB_LINEDOWN
        If $iDelta > 0 Then $iDirn = $SB_LINEUP
        For $i = 1 To 7 ; Schleife regelt die Scroll Geschwindigkeit, je mehr Durchläufe desto schneller
            _SendMessage($hWnd, $WM_VSCROLL, $iDirn)
        Next

    EndIf
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_Scrollbars_WM_MOUSEWHEEL

 

Scroll.zip

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