AutoHotkey Community

It is currently May 27th, 2012, 10:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: December 29th, 2007, 7:20 pm 
Offline

Joined: December 17th, 2007, 6:39 pm
Posts: 235
Location: Galati, Romania
How to create an indeterminate progressbar? Like this one:
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 7:52 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Try this:
Gui, Add, Progress, w300 h20 cBlue -smooth


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 7:57 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
I dont think thats right Mana. He wants a bar that continually has 2 "chunks" moving round. so doesnt actually display progress, just shows that it is "working"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 8:59 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Oh, maybe so. I admit I wasn't quite clear on the meaning of "indeterminate". But I think I understand now.


Last edited by ManaUser on December 29th, 2007, 9:15 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 9:08 pm 
Offline

Joined: December 17th, 2007, 6:39 pm
Posts: 235
Location: Galati, Romania
Well, this type of progressbars are defined as "indeterminate" by wikipedia and the Microsoft Developer Network. But I still didn't get the answer to my question. :cry:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 9:16 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Let's see, how about this then?

Quote:
PBS_MARQUEE - 0x8 - [Requires Windows XP or later] The progress bar moves like a marquee; that is, each change to its position causes the bar to slide further along its available length until it wraps around to the other side. A bar with this style has no defined position. Each attempt to change its position will instead slide the bar by one increment.

This style is typically used to indicate an ongoing operation whose completion time is unknown.


Here's a quick script demonstrating that:
Code:
#Persistent

Gui, Add, Progress, w150 h16 -Smooth vWorking +0x8
Gui Show
SetTimer Scroll, 100
Return

Scroll:
GuiControl,, Working, +1
Return

GuiClose:
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 9:30 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
mmm doesnt do anything for me :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 9:38 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
mean either


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 9:55 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Code:
PBS_MARQUEE := 0x8 , PBS_SMOOTH := 0x1
Gui, Add, Progress, -%PBS_SMOOTH% +%PBS_MARQUEE% w150 h15 vPro
Gui, Show
SetTimer, Progress, 75
Return

Progress:
GuiControl, ,Pro, %A_TickCount%
Return

GuiEscape:
GuiClose:
 ExitApp


:)

Edit:
Too late .. :)
@Manauser: No need for #Persistent when a script contains the GUI command


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 10:02 pm 
There is no need for SetTimer:
Code:
PBM_SETMARQUEE := 0x40a ;wm_user + 10
Gui, Add, Progress, x10 y10 w300 h15 HwndpHwnd1 -Smooth +0x8  ;0x8 =  PBS_MARQUEE
Gui, Show
PostMessage, PBM_SETMARQUEE, 1, 38, , ahk_id %pHwnd1% ;_wParam-Bool (1 = start , 0 = stop),lParam-Time (ms) between animation updates.
Return ;

GuiClose:
ExitApp


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 10:14 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Very nice. Thanks. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 11:21 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
tic wrote:
mmm doesnt do anything for me :?

Fry wrote:
mean either

That's odd... it works fine for me.
SKAN wrote:
@Manauser: No need for #Persistent when a script contains the GUI command

Oh, I guess not. Did mine work for you though?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2007, 11:59 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Dear Manauser, :)

Yes, your code works for me in XP SP2.

Quote:
#Persistent
If this directive is present anywhere in the script, that script will stay running after the auto-execute section (top part of the script) completes. This is useful in cases where a script contains timers and/or custom menu items but not hotkeys, hotstrings, or any use of OnMessage() or Gui.


in other words,

when a script contains hotkey,hotstrings,Onmessage() or Gui it automatically becomes Persistent.

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2007, 7:00 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
postmessage should not be required
http://www.autohotkey.com/forum/viewtopic.php?t=27049

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2007, 10:03 am 
Offline

Joined: December 17th, 2007, 6:39 pm
Posts: 235
Location: Galati, Romania
WOW! It really works. Thanks a lot! :D


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, chaosad, specter333 and 72 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group