What am I doing wrong in this example?
#include <GuiTab.au3>
Opt("MouseCoordMode", 2);
Local $gui = GUICreate("");
GUISetState(@SW_SHOW, $gui)
Local $tab = _GUICtrlTab_Create($gui, 20, 20);
_GUICtrlTab_InsertItem($tab, 0, "Bla");
Local $lastState;
Local $user32 = DllOpen("user32.dll");
While True
If _IsPressed("04", $user32) And Not $lastState Then
If WinActive($gui) Then
Local $hittest = _GUICtrlTab_HitTest($tab, -1, -1);
MsgBox(0, $hittest[0], $hittest[1]);
Local $hittest = _GUICtrlTab_HitTest($tab, MouseGetPos(0), MouseGetPos(1));
MsgBox(0, $hittest[0], $hittest[1]);
EndIf
$lastState = True
Else
$lastState = False
EndIf
If GUIGetMsg() = -3 Then ExitLoop;
WEnd
DllClose($user32)