..well, yeah. Otherwise I have to install audacity, make it crash and do what you're doing. And right now I don't have even the brain power to show you in a MsgBox.
..or maybe I do ...
#include <GuiConstants.au3> ; for GUISquare_Create()
Global $_g__Square_GUI[4], $_g__Square_Color = 0x00CC00, $_g__Square_Width = 3
If StringInStr($CmdLineRaw, "/msgBoxThing") Then Exit MsgBox(262144, "PointerPointingToTheControlDemo", "Where's the button ?")
ShellExecute(@AutoItExe, '"' & @ScriptFullPath & '" /msgBoxThing') ; run a MsgBox()
ConsoleWrite(PointerPointingToTheControl("PointerPointingToTheControlDemo", "", "Button1", 1, 50) & @CRLF)
Func PointerPointingToTheControl($sTitle, $sText, $sCtrlId, $bClickIt = False, $iSpeed = 10)
; https://www.autoitscript.com/forum/index.php?showtopic=212400&view=findpost&p=1537933
Local $hWin = WinWait($sTitle, $sText, 2) ; find the window in 2 seconds or quit
If Not $hWin Then Return SetError(1, 0, "! can't find the window")
Local $hCtrlId = ControlGetHandle($hWin, "", $sCtrlId) ; find the control in the window
If Not $hCtrlId Then Return SetError(2, 0, "! can't find the control")
Local $aCtrlIdPos = WinGetPos($hCtrlId) ; get the position of the control in the window
If @error Or UBound($aCtrlIdPos) <> 4 Then Return SetError(3, 0, "! can't find the control's position")
GUISquare_Create($aCtrlIdPos[0], $aCtrlIdPos[1], $aCtrlIdPos[2], $aCtrlIdPos[3]) ; <--- this may help ?
Local $hTimer = TimerInit()
MouseMove($aCtrlIdPos[0] + ($aCtrlIdPos[2] / 2), $aCtrlIdPos[1] + ($aCtrlIdPos[3] / 2), $iSpeed)
Do
Sleep(10)
Until TimerDiff($hTimer) > 500 ; ..to give you time to see it ?
If $bClickIt Then MouseClick("Main") ; click the darn thing
GUISquare_Delete()
Return "Found ya."
EndFunc ;==>PointerPointingToTheControl
Func GUISquare_Create($X, $Y, $W, $H)
$X -= $_g__Square_Width
$Y -= $_g__Square_Width
$W += $_g__Square_Width
$H += $_g__Square_Width
$_g__Square_GUI[0] = GUICreate("", $W, $_g__Square_Width, $X, $Y, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
$_g__Square_GUI[1] = GUICreate("", $_g__Square_Width, $H, $X, $Y, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
$_g__Square_GUI[2] = GUICreate("", $_g__Square_Width, $H, $X + $W, $Y, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
$_g__Square_GUI[3] = GUICreate("", $W + $_g__Square_Width, $_g__Square_Width, $X, $Y + $H, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
For $i = 0 To 3
GUISetBkColor($_g__Square_Color, $_g__Square_GUI[$i])
GUISetState(@SW_SHOW, $_g__Square_GUI[$i])
Next
EndFunc ;==>GUISquare_Create
Func GUISquare_Delete()
If Not $_g__Square_GUI[0] Then Return
For $i = 0 To 3
GUIDelete($_g__Square_GUI[$i])
$_g__Square_GUI[$i] = 0
Next
EndFunc ;==>GUISquare_Delete
Edit: Turned it into a function. 👏