rehnmark Posted September 7, 2006 Posted September 7, 2006 (edited) Hi! I need some help getting a cancel button on the progresson-window this is my code: ProgressOn("Ominstallation", "Kopierar Filer till " & $ws1) Run(@COMSPEC & ' /c psexec \\' & $ws1 & ' xcopy /S /E /C /H /R /Y k:\PEPreinstall\1.0.0\00\PreInstall.vbs c:\temp', "", @SW_HIDE) $PID = Run(@COMSPEC & ' /c psexec \\' & $ws1 & ' xcopy /S /E /C /H /R /Y k:\PEDeploy\1.0.0\00 c:\temp', "", @SW_HIDE) $x = 0 $Forward = 1 While ProcessExists($PID) Sleep(200) If $Forward Then If $x < 100 Then $x = $x + 1 Else $Forward = 0 EndIf Else If $x > 80 Then $x = $x - 60 Else $Forward = 1 EndIf EndIf ProgressSet($x) WEnd ProgressOff() While the progressbar is showing i want to be able to press a "cancelbutton" to cancel the process ... Anyone have any ideas? Thanx in advance Edited September 7, 2006 by rehnmark
PsaltyDS Posted September 7, 2006 Posted September 7, 2006 Hi! I need some help getting a cancel button on the progresson-window this is my code: ProgressOn("Ominstallation", "Kopierar Filer till " & $ws1) Run(@COMSPEC & ' /c psexec \\' & $ws1 & ' xcopy /S /E /C /H /R /Y k:\PEPreinstall\1.0.0\00\PreInstall.vbs c:\temp', "", @SW_HIDE) $PID = Run(@COMSPEC & ' /c psexec \\' & $ws1 & ' xcopy /S /E /C /H /R /Y k:\PEDeploy\1.0.0\00 c:\temp', "", @SW_HIDE) $x = 0 $Forward = 1 While ProcessExists($PID) Sleep(200) If $Forward Then If $x < 100 Then $x = $x + 1 Else $Forward = 0 EndIf Else If $x > 80 Then $x = $x - 60 Else $Forward = 1 EndIf EndIf ProgressSet($x) WEnd ProgressOff() While the progressbar is showing i want to be able to press a "cancelbutton" to cancel the process ... Anyone have any ideas? Thanx in advance You can create a custom GUI with a progress bar and a cancel button. The GUI created by ProgressOn() doesn't have options for buttons, I don't think. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Moderators SmOke_N Posted September 7, 2006 Moderators Posted September 7, 2006 You can create a custom GUI with a progress bar and a cancel button. The GUI created by ProgressOn() doesn't have options for buttons, I don't think. That's the easy/better way, you could always hack it up with AnyGUI I'm sure though. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
PsaltyDS Posted September 7, 2006 Posted September 7, 2006 That's the easy/better way, you could always hack it up with AnyGUI I'm sure though.OK, I'll bite... what's an AnyGUI? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Valuater Posted September 7, 2006 Posted September 7, 2006 OK, I'll bite... what's an AnyGUI? http://www.autoitscript.com/forum/index.ph...7&hl=AnyGUI8)
Valuater Posted September 7, 2006 Posted September 7, 2006 maybe... expandcollapse popupProgressOn("Ominstallation", "Kopierar Filer till " & $ws1) Run(@COMSPEC & ' /c psexec \\' & $ws1 & ' xcopy /S /E /C /H /R /Y k:\PEPreinstall\1.0.0\00\PreInstall.vbs c:\temp', "", @SW_HIDE) $PID = Run(@COMSPEC & ' /c psexec \\' & $ws1 & ' xcopy /S /E /C /H /R /Y k:\PEDeploy\1.0.0\00 c:\temp', "", @SW_HIDE) Dim $x = 0 $Forward = 1 AdlibEnable("pros") While ProcessExists($PID) $msg = GUIGetMsg() If $msg = $CANCEL_BUTTON Then AdlibDisable() ; hide/delete progress?? EndIf Sleep(200) If $Forward Then If $x < 100 Then $x = $x + 1 Else $Forward = 0 EndIf Else If $x > 80 Then $x = $x - 60 Else $Forward = 1 EndIf EndIf WEnd ProgressOff() Func pros() ProgressSet($x) EndFunc 8)
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