#include <Misc.au3>
#include <WinAPISys.au3>
While Sleep(10)
If _IsPressed("01") Then
$Point = _WinAPI_GetMousePos()
$hWnd = _WinAPI_WindowFromPoint($Point)
$Class = _WinAPI_GetClassName($hWnd)
$Caption = _WinAPI_GetWindowText($hWnd)
ConsoleWrite($Class & ":" & $Caption & @CRLF)
While _IsPressed("01")
Sleep(10)
WEnd
EndIf
WEnd