lafafmentvotre Posted May 3, 2010 Share Posted May 3, 2010 (edited) Hi everybody and sorry for my bad english by advanceI need a progressbar who are updated during different actions of my script.I use this function :Func WaitExecuteShowProcess() $xprogress=0 While ProcessExists("progress.exe") $xprogress=$xprogress+1 if $xprogress=100 then $xprogress=0 Sleep(30) GUICtrlSetData($Progressbar, $xprogress) WEnd EndFuncThis is the action :While 1 $u_msg = GUIGetMsg(1) Select Case $u_msg[0] = $GUI_EVENT_CLOSE Or $u_msg[0] = $exititem Or $u_msg[0] = $exitbutton ExitLoop Case $u_msg[0] = $all Check_all() Case $u_msg[0] = $none Uncheck_all() Case $u_msg[0]=$exportbutton Or $u_msg[0]=$exportitem;Export data Run("progress.exe") WaitExecuteShowProcess();the progressbar function sauvegarde();the different actions to save different folders checked in my Gui GUICtrlSetData ($progressbar,0) GUICtrlSetState($progressbar,$GUI_DISABLE) Wendand the "process.exe" :#NoTrayIcon TraySetState(2) While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop EndSelect WEnd ExitI do a Processclose("progress.exe") at the end of my sauvegarde() function.But the sauvegarde() function don't run because the WaitExecuteShowProcess() function pause script.Someone have an idea or issue to solve my problem ?Thanks for help Edited May 3, 2010 by lafafmentvotre Link to comment Share on other sites More sharing options...
99ojo Posted May 3, 2010 Share Posted May 3, 2010 Hi,what expected you with this code. You check ProcessExists. The process is closed by function call after WaitExecuteShowProcess.While ProcessExists("progress.exe") $xprogress=$xprogress+1 if $xprogress=100 then $xprogress=0 Sleep(30) GUICtrlSetData($Progressbar, $xprogress) WEndThis causes an endless loop. You have to check for other conditions then ProcessExists to end loop / function.Since i don't know what your progress.exe is doing, you have to solve the problem by yourself. It seems you are doing an export, so you might check with FileExists or FileGetSize the condition of your export.If your export is coded by yourself, a solution could be, writing a file, e.g. export.done, after export and check in your WaitExecuteShowProcess if the file exists and delete it then and exit loop.;-))Stefan Link to comment Share on other sites More sharing options...
lafafmentvotre Posted May 3, 2010 Author Share Posted May 3, 2010 Ok I change my condition and idea. Thanks for reply 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