Jump to content
Sign in to follow this  

TToolBar click

Recommended Posts


New to AutoIT and this forum. Your advice is welcome.

I searched the forums for an answer but had no success.

I'm trying to write a script that will update, then run spybot.

Unfortunately I can't get past the first step, clicking the "search" button on the "Spybot-S&D Updater" popup.

Here is the window/control Info:

>>>> Window <<<<

Title: Spybot-S&D Updater

Class: TformSpybotUpdater

Position: 552, 362

Size: 496, 475

Style: 0x16CF0000

ExStyle: 0x00010100

Handle: 0x00010BD4

>>>> Control <<<<

Class: TToolBar

Instance: 1

ClassnameNN: TToolBar1


Advanced (Class): [CLASS:TToolBar; INSTANCE:1]

ID: 789488


Position: 12, 338

Size: 464, 30

ControlClick Coords: 41, 16

Style: 0x5600984E

ExStyle: 0x00010000

Handle: 0x000C0BF0

>>>> Mouse <<<<

Position: 609, 752

Cursor ID: 2

Color: 0x000000

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

And my code is below. I've commented out various attempts to click, and I've tried a few others too.

WinActiveate was added per a suggestion from another thread, but it made no difference.

Since I get @error=0 I assume the ControlClick is not returning an error.

$hHandle displays a value that looks like hex, eg "0x000F0B80", so I assume that is working.

If FileExists("C:\Program Files\Spybot - Search & Destroy\SDUpdate.exe") Then

Run("C:\Program Files\Spybot - Search & Destroy\SDUpdate.exe")


MsgBox(0, "Spybot Update Error", "Cannot access SDUpdate! Exiting script")



WinWaitActive("Spybot-S&D Updater")

Local $hHandle = ControlGetHandle("Spybot-S&D Updater", "", "[CLASS:TToolBar;INSTANCE:1]")

;~ MsgBox(0, "Status", "Return status: " & @error)

;~ MsgBox(0, "ControlGetHandle Example", "The control handle is: " & $hHandle)

WinActivate("Spybot-S&D Update")

ControlClick("Spybot-S&D Updater", "[CLASS:TToolBar1]", $hHandle, "", 1, 41, 16)

;~ ControlClick("Spybot-S&D Updater", "&Search", "[TEXT:Search]")

;~ ControlClick("Spybot-S&D Updater", "&Search", $hHandle)

;~ ControlClick("Spybot-S&D Updater", "", $hHandle)

;~ ControlClick("Spybot-S&D Updater", "", "TToolBar")

;~ Send("{ALT}s")

;~ Send("{LCTRL}s")

MsgBox(0, "Status", "Return status: " & @error)

Share this post

Link to post
Share on other sites


Welcome to the AutoIt forum. :)

I believe a "TToolBar" is a Delphi control which is not created via the normal Windows API. Hence AutoIt cannot control it as it would an standard API contol. You may be limited to clicking the "x" and "y" coordinates within the GUI - with all the problems that brings. :(

Sorry to be the bearer of bad news - perhaps we can do better next time. ;)


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites


ControlClick('Spybot-S&D Updater', '', '[CLASS:TToolBar;INSTANCE:1]', '', 1, 41, 16)


ControlClick("Spybot-S&D Updater", "[CLASS:TToolBar1]", $hHandle, "", 1, 41, 16)

think you dont have win with "[CLASS:TToolBar1]" text in it :P;) its an honest mistake

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.


Share this post

Link to post
Share on other sites


Thank you BogQ, I see it now.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this