Adem_Koraani Posted April 29, 2022 Posted April 29, 2022 hey guys, im creating a program that execute vbscripts and iwant to add a progress bar indicating the progress of these vbscripts.
Developers Jos Posted April 29, 2022 Developers Posted April 29, 2022 Great, so what exactly is the question or the thing you need help with? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Solution Subz Posted April 29, 2022 Solution Posted April 29, 2022 (edited) It depends on how you want to display the progress for example, if you have 5 vbscripts and you want the bar to progress each time the new vbscript is executed you could just place your vbscripts into an array and then upon each execution you progress the bar by 100/arraycount for example: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> Local $aVBExample[] = ["Execute VBScript 1","Execute VBScript 2","Execute VBScript 3","Execute VBScript 4","Execute VBScript 5"] GUICreate("Progressbar1", 220, 40, 100, 200) Local $idProgressbar = GUICtrlCreateProgress(10, 10, 200, 20) GUISetState(@SW_SHOW) Local $iProgress = 100/(UBound($aVBExample)) For $i = 0 To UBound($aVBExample) - 1 $iProgressBar = GUICtrlRead($idProgressbar) + $iProgress GUICtrlSetData($idProgressbar, $iProgressBar) MsgBox(4096, "", $aVBExample[$i], 2) Next If your vbscripts take a long time to complete then would recommend using marquee, otherwise the end user may think the script is frozen, for example: #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> Local $aVBExample[] = ["Execute VBScript 1","Execute VBScript 2","Execute VBScript 3","Execute VBScript 4","Execute VBScript 5"] GUICreate("Progressbar2", 220, 40, 100, 200) Local $idProgressbar = GUICtrlCreateProgress(10, 10, 200, 20, $PBS_MARQUEE) GUISetState(@SW_SHOW) GUICtrlSendMsg($idProgressbar, $PBM_SETMARQUEE, 1, 50) For $i = 0 To UBound($aVBExample) - 1 MsgBox(4096, "", $aVBExample[$i], 2) Next Edited May 2, 2022 by Subz SkysLastChance 1
Adem_Koraani Posted April 29, 2022 Author Posted April 29, 2022 thanks for code it worked but when i put it in my script. ikeep getting a error message which says that the $PBS_MARQUEE and PBM_SETMARQUEE variables are used without being declared. itried to install marquee udf but istill get the same error message. any idea how can i get through this? Thanks.
Adem_Koraani Posted April 29, 2022 Author Posted April 29, 2022 1 hour ago, Jos said: Great, so what exactly is the question or the thing you need help with? how can i create a progress bar that indicate the execution progress of a vbscript? my english is kinda bad ihope you understand what i need
Subz Posted April 29, 2022 Posted April 29, 2022 You must use the #include <ProgressConstants.au3> at the top of your script, these include the $PBS_MARQUEE and $PBM_SETMARQUEE variables, I tested both scripts before posting.
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