Preventing Windows temporary from response to ...

Discussions related to the extensions to the language available in LBB
guest
Site Admin
Posts: 197
Joined: Tue Apr 03, 2018 1:34 pm

Re: Preventing Windows temporary from response to ...

Post 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
sarmednafi
Posts: 37
Joined: Fri Apr 06, 2018 6:27 am

Re: Preventing Windows temporary from response to ...

Post by sarmednafi »

Thank you, Richard,

That's very kind of you.

Sarmed.