Home   Index   About
Ultimate Pack


Custom Search
Overview
Group
Quick Info

Windows NT
Yes
Win95
No
Win32s
No
Import Library
user-defined
Header File
-
Unicode
No
Platform Notes
None

CopyProgressRoutine

[New - Windows NT]

The CopyProgressRoutine function is called when a portion of a copy operation started by CopyFileEx is completed. This function is an application-defined callback routine.

DWORD WINAPI CopyProgressRoutine(

LARGE_INTEGER TotalFileSize,
// total file size, in bytes
LARGE_INTEGER TotalBytesTransferred,
// total number of bytes transferred
LARGE_INTEGER StreamSize,
// total number of bytes for this stream
LARGE_INTEGER StreamBytesTransferred,
// total number of bytes transferred for this stream
DWORD dwStreamNumber,
// the current stream
DWORD dwCallbackReason,
// reason for callback
HANDLE hSourceFile,
// handle to the source file
HANDLE hDestinationFile,
// handle to the destination file
LPVOID lpData
// passed by CopyFileEx
);

Parameters

TotalFileSize

The total size of the file, in bytes.

TotalBytesTransferred

The total number of bytes transferred from the source file to the destination file since the copy operation began.

StreamSize

The total size of the current file stream, in bytes.

StreamBytesTransferred

The total number of bytes in the current stream that have been transferred from the source file to the destination file since the copy operation began.

dwStreamNumber

Identifies the current stream. The stream number is 1 the first time CopyProgressRoutine is called.

dwCallbackReason

Specifies the reason that CopyProgressRoutine was called. This parameter can be one of the following values:

Value
Meaning
CALLBACK_CHUNK_FINISHED
Another part of the data file was copied.
CALLBACK_STREAM_SWITCH
Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked.

hSourceFile

Identifies the source file.

hDestinationFile

Identifies the destination file

lpData

The argument passed to CopyProgressRoutine by the CopyFileEx function.

Return values

The CopyProgressRoutine function should return one of the following values:

Value
Meaning
PROGRESS_CONTINUE
Continue the copy operation.
PROGRESS_CANCEL
Cancel the copy operation and delete the destination file.
PROGRESS_STOP
Stop the copy operation. It can be restarted at a later time.
PROGRESS_QUIET
Continue the copy operation, but stop invoking CopyProgressRoutine to report progress.

Remarks

An application can use this information to display a progress bar that shows the total number of bytes copied as a percent of the total file size.

See Also

CopyFileEx


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2011 Free Tech Secrets ;) greatis just4fun network just4fun