AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reading progress bars-is it possible?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
andrei901



Joined: 20 Jan 2008
Posts: 27

PostPosted: Sat Jul 26, 2008 3:03 am    Post subject: Reading progress bars-is it possible? Reply with quote

Not sure how to better describe this post in my title, if anyone can think of something better, please suggest.

For the actuall post.

I have an antivirus program which takes a variable amount of time to run. Then, I want to have my computer run a registry mechanic. Finally, I want my computer to run Disk Defragmenter. I have had no issues with doing this myself and letting it run overnight, but some people are less computer literate, and want their computers to not become bogged down with viruses. Also, it wuld be a useful little tool in terms of efficiency. The only problem is that all of these programs run for variable amounts of time, depending on the integrity of the computer in question.

Originally, I used a code that was similar to:
Code:

::!^r::
Run, C:\Spybot.exe            ;I placed shortcuts to C: for easy use
Sleep, 30000                      ;Loading times
MouseClick, Left, 130,225    ;Click "Scan"
Sleep, 10800000                 ;Wait 3 hours
Send, {alt}{f4}                  ;Quit
Run, C:\CCleaner.exe
Sleep
...

You get the idea. (I hope)

Now, the problem is either:
A) inefficiency, takes too long.
B) Computer is so ****ed up that it takes longer than the already generous time provided.

My question is, is it possible to detect when a progress bar hits 100%, or reads "Done", and then have the script continue?

And if it is, could someone give me a hint?

Thank you.
_________________
-andrei901, your local wannabe AHK expert
Back to top
View user's profile Send private message AIM Address
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Sat Jul 26, 2008 3:19 am    Post subject: Reply with quote

you could detect it various ways.

First, use ControlClick to hit the scan button

you could use WinWait's WinText parameter to watch for a particular message on the window
you could use ControlGet to try and read the progressbar's value
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
andrei901



Joined: 20 Jan 2008
Posts: 27

PostPosted: Sun Jul 27, 2008 3:25 am    Post subject: Reply with quote

thank you.
_________________
-andrei901, your local wannabe AHK expert
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group