 |
 |

04-27-2002, 07:34 PM
|
 |
|
|
Join Date: Mar 2002
Location: Ohio, USA
Posts: 1,552
|
|
Progress Bar
|
The Program I am working on lets user COPY, CUT, PASTE, DELETE, etc. When moving a File I am trying to display a ProgressBar showing the amount left to move. I know so far how to get the File Size but not much more.
This is what I am trying to do
ex.
FilesSize = 546546
AmountLeft = 4367
ProgressBar1 = 10
Thanks
Chris 
|
|

04-27-2002, 07:36 PM
|
|
|
|

04-27-2002, 07:44 PM
|
 |
|
|
Join Date: Mar 2002
Location: Ohio, USA
Posts: 1,552
|
|
|
I am not using SFO. Becouse I'm not very familiar with it.
Do you thing I should do it using SFO ?
Chris
|
|

04-27-2002, 07:46 PM
|
|
|
|
I was just curious cause if u were using FSO, there
is probably no way u can use a 'Progress Bar' once
the (FSO)File transfer takes place.
|
|

04-28-2002, 01:18 AM
|
 |
Lost Soul
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Vorlon
Posts: 18,931
|
|
|
If you want a progress bar file copying or moving a file you have to write to copy/move code yourself.
Most (API) functions just do a copy.
|
|

04-28-2002, 05:58 AM
|
 |
Political Coder
Retired Moderator * Guru *
|
|
Join Date: Mar 2001
Location: London, England
Posts: 8,037
|
|
SHFileOperation API can copy a file and provides a neat documents-flying-thru-space animation and progressbar while it copies.
Code:
Option Explicit
Private Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Const FO_COPY = &H2
Private Const FO_MOVE = &H1
Private Sub Form_Load()
Dim SHOperation As SHFILEOPSTRUCT
'Set up the structure
With SHOperation
.wFunc = FO_COPY
.pFrom = "C:\ur_demo.exe"
.pTo = "C:\ur_demo_2.exe"
End With
'Copy the file
SHFileOperation SHOperation
End Sub

|
|

04-28-2002, 11:25 AM
|
 |
|
|
Join Date: Mar 2002
Location: Ohio, USA
Posts: 1,552
|
|
|
Thanks Squirm
I can copy the file but how do I set up the animation ?
Chris S.
|
|

04-28-2002, 11:31 AM
|
 |
Political Coder
Retired Moderator * Guru *
|
|
Join Date: Mar 2001
Location: London, England
Posts: 8,037
|
|
It does it automatically. If you're copying a small file then it happens too fast to see. Copying a 13Mb file took about 3 seconds. 
|
|

04-28-2002, 11:45 AM
|
 |
|
|
Join Date: Mar 2002
Location: Ohio, USA
Posts: 1,552
|
|
OK
Thanks Squirm
I copied a large file and it works.
Chris 
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|