Retrieves coordinates of the scroll bar
#include <GuiScrollBars.au3>
_GUIScrollBars_GetScrollBarRect ( $hWnd, $iObject )
$hWnd | Handle to the window |
$iObject | Specifies the scroll bar object. This parameter can be one of the following values: $OBJID_CLIENT - The $hWnd parameter is a handle to a scroll bar control. $OBJID_HSCROLL - The horizontal scroll bar of the $hWnd window. $OBJID_VSCROLL - The vertical scroll bar of the $hWnd window. |
Success: | an array in the following format: [0] - Left [1] - Top [2] - Right [3] - Bottom |
Failure: | sets the @error flag to non-zero. |
_GUIScrollBars_GetScrollBarInfoEx
#include <GUIConstantsEx.au3>
#include <GuiScrollBars.au3>
#include <WindowsConstants.au3>
Global $g_idMemo
Example()
Func Example()
Local $hGUIMsg, $hGUI, $aRect
$hGUI = GUICreate("ScrollBar Example", 400, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
$g_idMemo = GUICtrlCreateEdit("", 2, 2, 380, 360, BitOR($WS_HSCROLL, $WS_VSCROLL))
GUICtrlSetResizing($g_idMemo, $GUI_DOCKALL)
GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
GUISetBkColor(0x88AABB)
GUISetState(@SW_SHOW)
_GUIScrollBars_Init($hGUI)
$aRect = _GUIScrollBars_GetScrollBarRect($hGUI, $OBJID_HSCROLL)
MemoWrite("Horizontal" & @CRLF & "--------------------------------------")
MemoWrite("Left.........: " & $aRect[0])
MemoWrite("Top..........: " & $aRect[1])
MemoWrite("Right........: " & $aRect[2])
MemoWrite("Bottom.......: " & $aRect[3])
$aRect = _GUIScrollBars_GetScrollBarRect($hGUI, $OBJID_VSCROLL)
MemoWrite(@CRLF & "--------------------------------------" & @CRLF & "Vertical" & @CRLF & "--------------------------------------")
MemoWrite("Left.........: " & $aRect[0])
MemoWrite("Top..........: " & $aRect[1])
MemoWrite("Right........: " & $aRect[2])
MemoWrite("Bottom.......: " & $aRect[3])
While 1
$hGUIMsg = GUIGetMsg()
Switch $hGUIMsg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Exit
EndFunc ;==>Example
; Write a line to the memo control
Func MemoWrite($sMessage)
GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite