|
|
|||||||
Just recently started using KixGUI and im having a ton of fun writing with it. Attached below is a simple script that copies all files from my documents to network drive with a progress bar. My question is: How can a control the progress bar if a user clicks cancel or kills its. Im trying to display a message to the user in the event the user hits the cancel or kills the PB. Any help greatly appreciated Regards John $frm=$root.createform("frm","COPY FILES",210,100,350,100) $lbl1=$frm.addlabel("lbl1","Copying files from MY DOCUMENTS folder to your" +chr(10)+ "Network H: DRIVE" + chr(10)+chr(10)+ "PLEASE WAIT",10,2,300,200) $lbl1.borderstyle=0 $lbl1.textalign=1 ;center $frm.visible=1 ;Copies all files from my documents to H: drive $frm1=$root.createform("copyfrm","copy form", 200,200,300,100) $frm1.CopyFilePB("c:\Documents and Settings\@userid\My Documents\*.doc","H:\My Documents",0,1) |
||||||||
|
|
|||||||
very simple... use Win2k and offline folders... |
||||||||
|
|
|||||||
Dont want to turn on Offline folders, to many training problems(believe or not). |
||||||||
|
|
|||||||
When I tested, I found that when I hit 'Cancel' CopyFilePB returned a value of '1223.' Change your code like this... code:$rc=$frm1.CopyFilePB("c:\Documents and Settings\@userid\My Documents\*.doc","H:\My Documents",0,1) |
||||||||
|
|
|||||||
thanks Chris, thats perfect... I kept trying to see what @error code it returned and of course it only returned one 0 ... still trying to get the handle on kixgui... cheers John |
||||||||
|
|
|||||||
No problem. I might also suggest you use a system variable for your My Docs location. You can either pull the path out of the registry or you can use "%USERPROFILE%\My Documents." |
||||||||
|
|
|||||||
Thanks again for the solution, tips and quick response.. Cheers John |
||||||||
|
|
|||||||
John, Kixgui don't set the @error value, for some particular reason (well, size of the dll is one of them) On the other hand, the result is returned if you used a method (complete, error, something else), and yes there is a missing state in the manual. (same for copy, move and delete) |