jben Posted April 1, 2008 Share Posted April 1, 2008 (edited) Hi everyone, I'm currently looking at how I can improve my progressbar as with the code below its locked in the centre of the screen and doesn't allow me to do anything with it. The progress bar works but just doesn't really offer me any way of moving it etc. The code below will basically install software 1 then add 10 percent, then install software 2 and add 20 percent etc. The code displays the name of the item being installed above the progressbar and the percentage below. Is there any way I could implement this and have the option of modifying the bar so I can move it about etc. Thanks ProgressOn("Progress Meter", "Installing: Software 1", "0 percent") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; ; SOFTWARE 1 INSTALLATION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; ProgressSet(10,"10 percent", "Installing: Software 2") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; ; SOFTWARE 2 INSTALLATION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; ProgressSet(20,"20 percent", "Installing: Software 3") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; ; SOFTWARE 3 INSTALLATION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ProgressSet(100, "", "finished") Sleep(500) Edited April 1, 2008 by jben Link to comment Share on other sites More sharing options...
rudi Posted April 1, 2008 Share Posted April 1, 2008 Hi. Use some sleep() statements to see what's going on: ProgressOn("Progress Meter", "Installing: Software 1", "0 percent") sleep(1000) ProgressSet(10,"10 percent", "Installing: Software 2") sleep(1000) ProgressSet(20,"20 percent", "Installing: Software 3") sleep(1000) ProgressSet(100, "", "finished") Sleep(500) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
jben Posted April 1, 2008 Author Share Posted April 1, 2008 (edited) I want to be able to move the progress bar to top right of screen though and I can't. Looked at AutoIT documentation but cant work out how I could implement it Hi. Use some sleep() statements to see what's going on: ProgressOn("Progress Meter", "Installing: Software 1", "0 percent") sleep(1000) ProgressSet(10,"10 percent", "Installing: Software 2") sleep(1000) ProgressSet(20,"20 percent", "Installing: Software 3") sleep(1000) ProgressSet(100, "", "finished") Sleep(500) Regards, Rudi. Edited April 1, 2008 by jben Link to comment Share on other sites More sharing options...
herewasplato Posted April 1, 2008 Share Posted April 1, 2008 ...move the progress bar to top right of screen...tryProgressOn("Progress Meter", "Installing: Software 1", "0 percent", @DesktopWidth - 310, 0) Sleep(1000) ProgressSet(10, "10 percent", "Installing: Software 2") Sleep(1000) ProgressSet(20, "20 percent", "Installing: Software 3") Sleep(1000) ProgressSet(100, "", "finished") Sleep(500) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jben Posted April 1, 2008 Author Share Posted April 1, 2008 (edited) Fantastic stuff. That worked perfectly. Just added it to my progresson and bingo, my issue is now solved. Your the greatest. Thanks mate for all your help its really appreciated and saved me a few hours of frustration :-) Is this stuff mentioned anywhere in the AutoIT documentation?. just wondering where you get all these flags from (well if you call it a flag?) One last thing. How does that code work.?. I presume its some sort of coord. I also found that when I change my background resolution the progressbar still stays in the same position which is cool. Edited April 1, 2008 by jben Link to comment Share on other sites More sharing options...
Achilles Posted April 1, 2008 Share Posted April 1, 2008 Fantastic stuff. That worked perfectly. Just added it to my progresson and bingo, my issue is now solved.Your the greatest. Thanks mate for all your help its really appreciated and saved me a few hours of frustration :-)Is this stuff mentioned anywhere in the AutoIT documentation?. just wondering where you get all these flags from (well if you call it a flag?)One last thing. How does that code work.?. I presume its some sort of coord. I also found that when I change my background resolution the progressbar still stays in the same position which is cool.Check the helpfile that comes with the AutoIt installation. If you look for ProgressOn under the index you can find out all about the function.The code works because herewasplato put in coord positions for where the top left pixel of the window should be. Basically, @DesktopWidth - 310 is 310 pixels aways from the right edge of your screen. Then the 0 obviously makes it so that the top of the progress window is at the very top of your screen. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
herewasplato Posted April 1, 2008 Share Posted April 1, 2008 ...Thanks mate...You are welcome....How does that code work.?. ...It works very well :-)Seriously, Achilles answered this in his post - if you need/want more info, PM me. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jben Posted April 1, 2008 Author Share Posted April 1, 2008 (edited) Brilliant stuff. Thanks you 2, the explanation was great to. Have a good evening\day (Don't know what part of the pond your from). But here is some code to get the answer: ShellExecute(@ScriptDir & "RegeditFindCountry.exe");checks the registry to find your country While 1 If WinExists(("You live in the UK") Then _UK() ExitLoop ElseIf WinExists("You live in the USA") Then _USA() ExitLoop EndIf Sleep(100) WEend Func _UK() Send ("Good evening") endfunc Func _USA() Send ("Good Afternoon") endfunc Sorry I missed out other countrys but you get the idea :-) haha Edited April 1, 2008 by jben 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