Function Reference


_GUICtrlStatusBar_GetRect

Retrieves the bounding rectangle of a part

#include <GuiStatusBar.au3>
_GUICtrlStatusBar_GetRect ( $hWnd, $iPart )

Parameters

$hWnd Handle to the control
$iPart 0-based part index

Return Value

Success: an array with the following format:
    $aRect[0] = X coordinate of the upper left corner of the rectangle
    $aRect[1] = Y coordinate of the upper left corner of the rectangle
    $aRect[2] = X coordinate of the lower right corner of the rectangle
    $aRect[3] = Y coordinate of the lower right corner of the rectangle
Failure: sets the @error flag to non-zero.

Related

_GUICtrlStatusBar_GetRectEx

Example

#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Global $g_idMemo

Example()

Func Example()
    Local $hGUI, $aRect, $hStatus
    Local $aParts[3] = [75, 150, -1]

    ; Create GUI
    $hGUI = GUICreate("StatusBar Get Rect", 400, 300)
    $hStatus = _GUICtrlStatusBar_Create($hGUI)

    ; Create memo control
    $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
    GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
    GUISetState(@SW_SHOW)

    ; Set/Get parts
    _GUICtrlStatusBar_SetParts($hStatus, $aParts)

    ; Get part 1 rectangles
    $aRect = _GUICtrlStatusBar_GetRect($hStatus, 0)
    MemoWrite("Part 1 left ...: " & $aRect[0])
    MemoWrite("Part 1 top ....: " & $aRect[1])
    MemoWrite("Part 1 right ..: " & $aRect[2])
    MemoWrite("Part 1 bottom .: " & $aRect[3])

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

; Write message to memo
Func MemoWrite($sMessage = "")
    GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite