Home > Language Reference > Windows Management Functions > WinScrollBar

WinScrollBar

The WinScrollBar function simulates a scrollbar click.

Usage

Prefer to automate a Page Down (using SendKeys ("<PageDown>") statement) as a scrollbar click is not precise.

Syntax

ret=WinScrollBar (H|V, <count>, line|pg|abs)

Parameters

H|V, keyword, scrolling type, H for Horizontal scrolling, V for Vertical scrolling.

<count>, integer, number of scrolls. If the next parameter is abs, <count> is positive starting at 0, if the next parameter equals pg or line, <count> simulates relative scrolls and can be negative or positive.

line|pg|abs, keyword. Use line for scrolling by lines, pg for scrolling by pages, and abs for absolute positioning.

Return value

ret, optional numeric return value. If the scrollbar has been successfully clicked within 30 seconds (this default value can be changed using #ActionTimeout , the function returns 0. If the function fails, the return value is a nonzero value (see Window Functions Error Codes).

Remarks

ClickScrollBar function is used when the scrollbar is a separate control within the last window specified by the most recent UseWindow. If the scrollbar is part of the last window specified by the most recent UseWindow, WinScrollBar function is used.

See also

ClickScrollbar

Example

UseWindow("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1)
 WinScrollBar(V,-1,PG)
 WinScrollBar(V,1,LINE)