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 

Progress bar

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






PostPosted: Fri Dec 11, 2009 10:16 am    Post subject: Progress bar Reply with quote

hi í want to provide a progress bar which will tell the progress of current action which is executing...in short how to attach a progress bar to current execution script which will tell how far the execution reached

well i read the help manual and also few forums regarding progress bar but i am still confused
Back to top
Guest






PostPosted: Fri Dec 11, 2009 10:22 am    Post subject: Reply with quote

ok first u need to determine how the progress bar works
for example:
if u have a function that loops 50 times
then clearly each loop is 2%, so what u would do is +2 the progress bar every time the function loop, so at the end it will be 100%
Back to top
Guest






PostPosted: Fri Dec 11, 2009 10:24 am    Post subject: Reply with quote

example:
Code:
Gui, Add, Progress, Vertical vMyProgress
Gui, Show

loop 50
{
; whatever function here
GuiControl,, MyProgress, +2
sleep 10
}
Back to top
Guest






PostPosted: Fri Dec 11, 2009 10:29 am    Post subject: Reply with quote

thanks a lot but how we can work for the below code
Code:

Gui,Add, Button,gNotepad x6 y6 w100 h30 , Notepad
Gui, Add, Progress, w300 h20 cBlue vMyProgress
Gui,Show
return

Notepad:
gui submit,nohide
gui +alwaysontop

Run notepad.exe
WinWaitActive Untitled - Notepad
send hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
send {Enter}
send bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

Return
esc::ExitApp


like when it finishes up sending the last b the progress bar should show 100% but when the process is on like from sending h to last b the progress bar should keep on incrementing till the last b is reached..how to achieve this in the above case???
Back to top
Eedis



Joined: 12 Jun 2009
Posts: 1158
Location: Indianapolis IN, USA

PostPosted: Fri Dec 11, 2009 6:06 pm    Post subject: Reply with quote

Code:
Gui, Add, Button,gNotepad x6 y6 w100 h30 , Notepad
Gui, Add, Progress, w300 h20 cBlue vMyProgress Range1-240
Gui, Show
return

Notepad:
gui submit,nohide
gui +alwaysontop

Run notepad.exe
WinWaitActive Untitled - Notepad
loop, 120
{
send h
guicontrol,, MyProgress, +1
}
send {Enter}
loop, 120
{
send b
GuiControl,, MyProgress, +1
}

Return
esc::ExitApp

_________________
www.AutoHotkey.net/~Eedis
I love my wife and daughter so much.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Lemming



Joined: 20 Dec 2005
Posts: 165
Location: Malaysia

PostPosted: Sat Jan 30, 2010 4:37 pm    Post subject: Try Progress command Reply with quote

There's also the Progress feature. In the example below, just change LoopCount to any integer value suitable for your program:

Code:
LoopCount = 6   ; Any integer value that is more than 1

LoopMultiplier := 100 / LoopCount   ; for divvying up the count

MainText := "Press any key to continue"

Loop, %LoopCount%
   {
   If (A_Index=LoopCount)
      MainText := "Done !"   ; End of count, change main text
   Progress, B W200, %A_Index% / %LoopCount% , %MainText%, My Title
   CurrProgress := A_Index * LoopMultiplier
   Progress, %CurrProgress% ; Set the position of the bar to x%
   Input, OutputVar, L1   ; press any key to continue
   }
Progress, Off   

ExitApp
Back to top
View user's profile Send private message
Display posts from previous:   
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