Jump to content

Recommended Posts

Posted

Hi Gurus,

I am brand new to AutoIT and I'm hooked already, but I need a kickstart.

The script I am writing will install and run various programs. CCleaner (www.ccleaner.com) is an example. However, I am getting stuck on 2 things:

1. When I run the program it runs for an indeterminate time, anything from 1 second to a minute before producing output in a listview control on the same window. How do I set the script to wait till the output appears?

2. I am using the gettext method to try and grab the output from the listview control and put it in my own list control, but this does not seem to work. The info tool identifies the listview control as syslistview321. I would appreciate any help.

Test code is attached

Thanks,

RichardFromOZ

CCleaner.au3

  • 4 months later...
Posted

Bit late I know :) but here is concept (not tested):

Run("c:\program files\ccleaner\ccleaner.exe")
WinWaitActive("CCleaner","")
ControlClick("CCleaner", "", 2) ;run cleaner

;~ Sleep(5000)
While ControlListView("CCleaner", "", "SysListView321",'GetItemCount') = 0
    Sleep(100)
WEnd

ControlListView("CCleaner", "", "SysListView321", "SelectAll")
ControlListView("CCleaner", "", "SysListView321", "Deselect", 2, 5)

;~ MsgBox(0, "", ControlListView("CCleaner", "", "SysListView321", "GetText", 9, 0) )
;~ MsgBox(0, "", ControlListView("CCleaner", "", "SysListView321", "FindItem", "CLEANING COMPLETE", 1) )
;~ MsgBox(0, "", ControlListView("CCleaner", "", "SysListView321", "GetSelected", 1) )

While ControlListView("CCleaner", "", "SysListView321", "FindItem", "CLEANING COMPLETE", 1) = -1
    Sleep(100)
WEnd

$var1 = ControlListView("CCleaner", "", "SysListView321", "GetText", 9, 0)
_GUICtrlListInsertItem($List1, $var1, -1)

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
×
×
  • Create New...