# Function Reference

# _GUICtrlTab_HitTest

Determines where a point lies control

#include <GuiTab.au3>
_GUICtrlTab_HitTest ( $hWnd, $iX, $iY )

## Parameters

$hWnd | Control ID/Handle to the control
$iX | X position to test
$iY | Y position to test

## Return Value

Returns an array with the following format:
[0] - 0-based index of the tab, or -1 if no tab is at the position
[1] - Results of the hit test:
1 - The position is not over a tab
2 - The position is over a tab's icon
4 - The position is over a tab's text

## Example

### Example 1

    #include "Extras\HelpFileInternals.au3"

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

    Example()

    Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("Tab Control HitTest (v" & @AutoItVersion & ")", 450, 300, 100, 100)
        Local $idTab = GUICtrlCreateTab(2, 2, 446, 266)
        _MemoMsgBoxStatus() ; Status creation

        GUISetState(@SW_SHOW)

        ; Add tabs
        _GUICtrlTab_InsertItem($idTab, 0, "Tab 0")
        _GUICtrlTab_InsertItem($idTab, 1, "Tab 1")
        _GUICtrlTab_InsertItem($idTab, 2, "Tab 2")

        ; Do a hit test
        Local $aHit = _GUICtrlTab_HitTest($idTab, 80, 10)
        _MemoMsgBox($MB_SYSTEMMODAL, "Information", "Point [80,10] is over tab " & $aHit[0])

        _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

    EndFunc   ;==>Example

### Example (OutProcess) : Tab HitTest 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 diffent mode
        Local $hTabCtrl = _MemoCreateOutProcess($hWin, "SysTabControl32", 1, $sFromTo)

        Local $aHit = _GUICtrlTab_HitTest($hTabCtrl, 100, 10)
        _MemoMsgBox($MB_SYSTEMMODAL, "Info" & $sFromTo, "Point [100,10] is over tab " & $aHit[0])

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

    EndFunc   ;==>Example