Page 2 of 2

Re: Preventing Windows temporary from response to ...

Posted: Sun Apr 15, 2018 3:35 pm
by guest
sarmednafi wrote: Sun Apr 15, 2018 3:14 pm What I need and I don't know if I can do it is tow keys to scroll the horizontal scrollbar into steps (I think I can get over that).
The program below automates scrolling a Graphics Window and a GRAPHICBOX so hopefully the same technique will work with a LISTBOX.

Richard.

Code: Select all

    nomainwin
    WindowWidth = 332
    WindowHeight = 356
    UpperLeftX = 200
    graphicbox #w.gb, 0, 0, 318, 318
    open "Graphicbox scroll test" for window as #w
    #w "trapclose quit"
    #w.gb "vertscrollbar on 100 800"
    #w.gb "horizscrollbar on 100 800"
    #w.gb "down; size 4"
    #w.gb "line 100 100 1100 1100"
    #w.gb "line 100 1100 1100 100"
    #w.gb "flush"

    UpperLeftX = 550
    open "Graphic window scroll test" for graphics as #g
    #g "trapclose quit"
    #g "vertscrollbar on 100 800"
    #g "horizscrollbar on 100 800"
    #g "down; size 4"
    #g "line 100 100 1100 1100"
    #g "line 100 1100 1100 100"
    #g "flush"

    timer 10, [scroll]
    wait

[scroll]
    if increment = 0 then increment = 2 : hscroll = 100
    hscroll = hscroll + increment
    if hscroll >= 800 then increment = -2
    if hscroll <= 100 then increment = 2
    wparam = hscroll * 65536 + _SB_THUMBPOSITION
    hgb = hwnd(#w.gb)
    calldll #user32, "SendMessageA", hgb as ulong, _
      _WM_HSCROLL as long, wparam as long, 0 as long, r as void
    hg = hwnd(#g)
    calldll #user32, "SendMessageA", hg as ulong, _
      _WM_HSCROLL as long, wparam as long, 0 as long, r as void
    wait

sub quit h$
    close #w
    close #g
    end
end sub

Re: Preventing Windows temporary from response to ...

Posted: Sun Apr 15, 2018 4:25 pm
by sarmednafi
Thank you, Richard,

That's very kind of you.

Sarmed.