Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scrollbar, trackbar (slider)
#1
How would one move a horizontal/vertical scrollbar?

I have searched the forum and help file and can't find anything referring to this.

Thank you.
#2
Easier - MouseWheel function.

Or, use accessible object functions. Example:
Code:
Copy      Help
Acc a=acc("Line down" "PUSHBUTTON" win("" "ExploreWClass") "SysListView32" "" 0x1021)
rep 3
,a.DoDefaultAction

In "Find accessible object", select Filters "Show useless" and Options "Search useless".

In Internet Explorer, use html element functions. Example:
Code:
Copy      Help
Htm el=htm("BODY" "" "" win("" "IEFrame") 0 0 0x20)
el.Scroll("down")
#3
I apolgozie Gintaras, I had given the wrong information earlier. See the image below. I used acc to get the ROLE, CLASS and ID, and it is not a scroll bar :lol:


I am trying to automate this feature it will move the slider bar all the way to the right. The amount is $200 as minimum and the maximum amount all depends, depending on who is making a payment. So the maximum amount can be from $1,000 to $10,000.

Window class is MSCTLS_TRACKBAR32 and the ID is 541.


Attached Files Image(s)
   
#4
Example:

Code:
Copy      Help
int value=10
def TBM_SETPOS (WM_USER+5)
int hwnd=id(1005 win("Options" "#32770"))
SendMessage hwnd TBM_SETPOS 1 value
#5
I am really sorry to be giving you tid bits of information. It kinda works, I think we are almost there. But, when the slider moves, it is suppose to place the maximum amount in the edit box below it. With the example you provided, it does move the slider but the amount does not change. The edit box is read only. I think it would have been easier if it wasnt.

See attached picture please.


Attached Files Image(s)
   
#6
Function SetTrackbarPos
Code:
Copy      Help
;/
function hwndTB value [flags] ;;flags: 1 don't notify parent

;Sets trackbar control thumb position.
;value should be between min and max values of the trackbar control (use GetTrackBarInfo to get)


;EXAMPLE
;int hwndTB=id(1001 win("" "Volume Control"))
;int rmin rmax
;GetTrackbarInfo hwndTB rmin rmax ;;get range
;SetTrackbarPos hwndTB rmin+rmax/2 ;;set middle value
;bee
;1
;SetTrackbarPos hwndTB rmin ;;set min value (max sound)
;bee



def TBM_SETPOS (WM_USER+5)
def TBS_VERT 0x0002
def TB_THUMBPOSITION 4
def TB_THUMBTRACK    5
def TB_THUMBPOSITION  4
def TB_ENDTRACK     8

SendMessage hwndTB TBM_SETPOS 1 value

if(flags&1=0)
,int hwnd=GetParent(hwndTB)
,int msg=iif(GetWinStyle(hwndTB)&TBS_VERT WM_VSCROLL WM_HSCROLL)
,value<<16
,SendMessage hwnd msg TB_THUMBTRACK|value hwndTB
,SendMessage hwnd msg TB_THUMBPOSITION|value hwndTB
,SendMessage hwnd msg TB_ENDTRACK hwndTB

Function GetTrackbarInfo
Code:
Copy      Help
;/
function# hwndTB [&rangeMin] [&rangeMax]

;Returns trackbar control thumb position and optionally more info.


def TBM_GETPOS (WM_USER)
def TBM_GETRANGEMIN (WM_USER+1)
def TBM_GETRANGEMAX (WM_USER+2)

if(&rangeMin) rangeMin=SendMessage(hwndTB TBM_GETRANGEMIN 0 0)
if(&rangeMax) rangeMax=SendMessage(hwndTB TBM_GETRANGEMAX 0 0)
ret SendMessage(hwndTB TBM_GETPOS 0 0)
#7
PERFECT :lol: Big Grin Tongue

Thank you so much.


Forum Jump:


Users browsing this thread: 1 Guest(s)