THeckel Posted September 28, 2012 Share Posted September 28, 2012 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 Name: Advanced (Class): [CLASS:TToolBar; INSTANCE:1] ID: 789488 Text: 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") Else MsgBox(0, "Spybot Update Error", "Cannot access SDUpdate! Exiting script") Exit EndIf 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) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 28, 2012 Moderators Share Posted September 28, 2012 THeckel,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. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
bogQ Posted September 28, 2012 Share Posted September 28, 2012 (edited) its ControlClick('Spybot-S&D Updater', '', '[CLASS:TToolBar;INSTANCE:1]', '', 1, 41, 16) not ControlClick("Spybot-S&D Updater", "[CLASS:TToolBar1]", $hHandle, "", 1, 41, 16) think you dont have win with "[CLASS:TToolBar1]" text in it its an honest mistake Edited September 28, 2012 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - 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. Link to comment Share on other sites More sharing options...
THeckel Posted September 28, 2012 Author Share Posted September 28, 2012 SOLVED> Thank you BogQ, I see it now. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now