Funktionreferenz


_GUICtrlTab_GetItemRectEx

Beschreibung anzeigen in

Ermittelt das begrenzende Rechteck für einen Tab

#include <GuiTab.au3>
_GUICtrlTab_GetItemRectEx ( $hWnd, $iIndex )

Parameter

$hWnd Control-ID / Handle des Controls
$iIndex 0-basierender Itemindex

Rückgabewert

Gibt eine $tagRECT Struktur zurück, welche das Rechteck eines Tabs ermittelt (in Viewport-Koordinaten x,y)

Bemerkungen

- - - - - - - - Erklärung der Controls - - - - - - - -

Verwandte Funktionen

$tagRECT, _GUICtrlTab_GetItemRect

Beispiel

Beispiel 1

#include "Extras\HelpFileInternals.au3"

#include <GUIConstantsEx.au3>
#include <GuiTab.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    ; Erstellt eine GUI
    Local $hGUI = GUICreate("Tab-Control: Ermittelt das Item RectEx (v" & @AutoItVersion & ")", 500, 300, 100, 100)
    Local $idTab = GUICtrlCreateTab(2, 2, 446, 266)
    _MemoMsgBoxStatus() ; Statuserstellung

    GUISetState(@SW_SHOW)

    ; Fügt Tabs hinzu
    _GUICtrlTab_InsertItem($idTab, 0, "Tab 0")
    _GUICtrlTab_InsertItem($idTab, 1, "Tab 1")
    _GUICtrlTab_InsertItem($idTab, 2, "Tab 2")

    ; Ermittelt das Rechteck von Item 0
    Local $tRECT = _GUICtrlTab_GetItemRectEx($idTab, 0)
    Local $sRect = StringFormat("[%d, %d, %d, %d]", DllStructGetData($tRECT, "Left"), _
            DllStructGetData($tRECT, "Top"), _
            DllStructGetData($tRECT, "Right"), _
            DllStructGetData($tRECT, "Bottom"))
    _MemoMsgBox($MB_SYSTEMMODAL, "Information", "Zeigt Rechteck #0 an: " & $sRect)

    _MemoMsgBoxStatus("", -1, $hGUI) ; Keine weiteren Aktionen, es wird gewartet bis die GUI geschlossen wird.
EndFunc   ;==>Example

Example (OutProcess) : Tab Get Item RectEx to an External process

#include "Extras\HelpFileInternals.au3"

#include <GuiTab.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $sFromTo
    Local $hWin = _MemoRunAU3OutProcess($sFromTo, False) ; OK also if running in different mode
    Local $hTabCtrl = _MemoCreateOutProcess($hWin, "SysTabControl32", 1, $sFromTo)

    Local $tRECT = _GUICtrlTab_GetItemRectEx($hTabCtrl, 0)
    Local $sRect = StringFormat("[%d, %d, %d, %d]", DllStructGetData($tRECT, "Left"), _
            DllStructGetData($tRECT, "Top"), _
            DllStructGetData($tRECT, "Right"), _
            DllStructGetData($tRECT, "Bottom"))
    _MemoMsgBox($MB_SYSTEMMODAL, "Info" & $sFromTo, "Display #0 rectangle : " & $sRect)

    _MemoMsgBoxStatus("", -1, $hWin) ; no more action, wait GUI for closing, close also OutProcess GUI

EndFunc   ;==>Example