My.ProgressBar for Backups?  
Author Message
Docpro777





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

Its *good for users* to have a ProgressBar Indicator during backups of tables (while they wait for "who-knows-how-long", etc.).

'Twould be so nice for our users to be able to have:

1) the *Windows Flying Paper Progressbar* (during Window's copy/paste of files)

...or...

2) a 'Themed-progressbar' step-timed to the number of BYTES transferring during backup. (not just a wait window/Marquee (like Windows startup-progressbar), which leaves the user *hanging* about when its going to finish)

Please try to help me (I'll continue researching this and let you-all know if I've found a ProgressBar routine that step-times according to actual bytes being copied)




Visual FoxPro2  
 
 
Docpro777





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

...Well, found the flying-paper progressbar FILECOPY.AVI in the Home(4) ... Graphics\Videos\FILECOPY.AVI. and dropped it on a progressbar-form (OLE object)

Graphics are choppy during VFP9 resource hogging.

I've converted it to GIF (GIF Movie Gear) and made other GIF animations, but graphics becaming more choppy.

BIG QUESTION:

HOW can one SLOW DOWN VFP PROCESSING to allow for OLE or GIF animations, during :

re-indexing,
packing
backup
SQL queries
etc.

Thank you in advance


 
 
Ken Murphy





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

Do you really want to slow VFP down, just so you can show somebody an annimation telling them that the process is slow   Your users would probably be just as happy if you didn't slow it down.

 

Ken



 
 
Docpro777





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

Do you really want to slow VFP down, just so you can show somebody an annimation telling them that the process is slow


Yes, Ken, Thank you for your thoughts though.

I've dealt with some success with Choppy animations (and to a lessor extent, progress bars) by using OLE controls and adhoc timers.

Adhoc Timers help some but they LOSE track of time ... after an interval or 2 they STOP WORKING, e.g., until the PACK in completed.

Ken, methinks 'faster time' is less professional and less frustrating to my users than 'flying paper' animations and progress bars, else we'd be going back to using faster MSDOS COPY commands.

Solutions thus far:
1) Ahoc timer objects
2) OLE objects (which seem to 'thread-out' better in some tests)
3) Multiple wait commands (wait window '' timeout 0.01)

Notwithstanding, PACK, REINDEX, COPY TO, and APPEND FOR, are serious windows-resource hogs peculiar to VFP.

Yet, I can listen to processor intensive MP3s simultaneously during PACKs (no problem).

So I will find another OLE or COM solution, Lord willing.



 
 
Docpro777





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

Currently I'm experimenting with the venerable ctl32_ProgressBar Class by Carlos Alloatti.
(and the statusbar progressbar)

... during "BACKUPS" and 'PACKS during oApp.cleanup', Choppiness is still an issue even with Alloatti's professional 'bar' classes ..in:
- Top-level form progressbars
- Statusbar progressbars
- Desktop form progressbars

I suppose during BACKUPS I'll consider:
1) creating a seperate 'progressbar.exe' with W-API calls
2) Trying yet some other OLE progressbar or something.
3) Creating an OLE avi movie progressbar (I've had success with the "windows flying paper.avi")



 
 
calloatti.gmail





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

Yes, you will have a choppy progressbar with the ctl32_progressbar. After all, its been updated with a VFP timer when you put it on PLAY.

I wonder if a C dll that will receive the hwnd of the progressbar could take care of the update and avoid the choppiness. The dll would only have to send a window message to the progressbar every few milliseconds, and stop when another of its funcitons is called. Anyway I don’t know how to do that. Maybe someone could volunteer.

Your backups are just copying files from one location to another There is a API function or Shell object to copy folders that shows a progress window, just like when you copy files in Explorer....found it:

LOCAL oShell, oSrcFolder, oDstFolder

oShell = CREATEOBJECT("Shell.Application")
oSrcFolder = oShell.NameSpace("c:\windows\help")
oDstFolder = oShell.NameSpace("c:\temp")

IF VARTYPE(oDstFolder)="O" AND VARTYPE(oSrcFolder.Items)="O"
oDstFolder.CopyHere(oSrcFolder.Items)
ENDIF

COPY TO solved, now there is only PACK, REINDEX and APPEND to solve....

Carlos

 
 
Docpro777





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

Thank you for this excellent feedback.

 
 
Docpro777





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

(I thought I replied to this 3 days ago ).

I've integrated the CREATEOBJECT("Shell.Application") as Carlos responded, and it works VERY well for backup calls.

Again, extreme thanks for such invaluable pearls.



 
 
calloatti.gmail





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

Just some extra info:

You can copy one file, or some files, instead of a whole folder, like this:

LOCAL oShell, oDstFolder

oShell = CREATEOBJECT("Shell.Application")
oDstFolder = oShell.NameSpace("c:\temp")

IF VARTYPE(oDstFolder)="O"
oDstFolder.CopyHere("c:\windows\help\*.chm")
ENDIF

That is so fast it will not even show a progress dialog.

BUT! Read this first:

"
Programs or scripts that use the CopyHere method might not copy items that are specified by using a wildcard character"
http://support.microsoft.com/kb/835926/en-us

Carlos

 
 
Docpro777





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

Thank you again ...

It seems that using oShell
... allows windows resources to be threaded out better during VFP backup, and
... the backups seem faster (faster than the COPY command)

Your reference is helpful for me to study on oShell verbs



 
 
idoleyezharry





PostPosted: Visual FoxPro General, My.ProgressBar for Backups? Top

hi can you help me how make a code for my myspace background........ i Want my background to fly from up then side then down ,,,just like the 3d flying object..........hope you can help me!!!!