Function Reference


_GUICtrlStatusBar_GetRectEx

Retrieves the bounding rectangle of a part

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

Parameters

$hWnd Handle to the control
$iPart 0-based part index.
If the control is in simple mode this field is ignored and the rectangle of the status bar is returned.

Return Value

Success: a $tagRECT structure that receives the bounding rectangle.
Failure: sets the @error flag to non-zero.

Related

$tagRECT, _GUICtrlStatusBar_GetRect

Example

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

Global $g_idMemo

Example()

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

    ; Create GUI
    $hGUI = GUICreate("StatusBar Get RectEx", 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
    $tRECT = _GUICtrlStatusBar_GetRectEx($hStatus, 0)
    MemoWrite("Part 1 left ...: " & DllStructGetData($tRECT, "Left"))
    MemoWrite("Part 1 top ....: " & DllStructGetData($tRECT, "Top"))
    MemoWrite("Part 1 right ..: " & DllStructGetData($tRECT, "Right"))
    MemoWrite("Part 1 bottom .: " & DllStructGetData($tRECT, "Bottom"))

    ; 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