Hi guys, I am facing the same issue with a script for Teradata SQL. I need the script to open a connection and to do so it must be able to click on the area I marked in red.
Even the debug mode isn't helping because it says that everything is executed successfully but the new window is not opening.
A copy of my script:
ConsoleWrite("Waiting for Teradata SQL Assistant window..." & @CRLF)
Local $hWnd = WinWait("Teradata SQL Assistant", "", 10)
; Check if the window handle was obtained successfully
If $hWnd Then
ConsoleWrite("Teradata SQL Assistant window found." & @CRLF)
; Get the handle of the main window
$hWnd = WinGetHandle("Teradata SQL Assistant")
; Check if the main window handle is valid
If $hWnd Then
ConsoleWrite("Activating Teradata SQL Assistant window..." & @CRLF)
; Activate the Teradata SQL Assistant window
WinActivate($hWnd)
WinWaitActive($hWnd)
; Find and click the toolbar area to start a connection
ConsoleWrite("Finding toolbar area..." & @CRLF)
Local $hToolbar = ControlGetHandle($hWnd, "", "[NAME:_MainWnd_Toolbars_Dock_Area_Top]")
; Check if the toolbar control handle was obtained successfully
If $hToolbar Then
ConsoleWrite("Toolbar area found. Clicking..." & @CRLF)
; Click on the toolbar area (adjust the coordinates as needed)
ControlClick($hWnd, "", $hToolbar, "left", 1, 25, 65)
Else
ConsoleWrite("Error: Failed to find the toolbar area." & @CRLF)
MsgBox(16, "Error", "Failed to find the toolbar area.")
EndIf
Else
ConsoleWrite("Error: Failed to get the handle of the main window." & @CRLF)
MsgBox(16, "Error", "Failed to get the handle of the main window.")
EndIf
Else
ConsoleWrite("Error: Teradata SQL Assistant window not found." & @CRLF)
MsgBox(16, "Error", "Teradata SQL Assistant window not found.")
EndIf