网站首页  词典首页

请输入您要查询的函数:

 

术语 copyprogressroutine
释义 CopyProgressRoutine
语法:
C++
DWORD CALLBACK CopyProgressRoutine(
__in LARGE_INTEGER TotalFileSize,
__in LARGE_INTEGER TotalBytesTransferred,
__in LARGE_INTEGER StreamSize,
__in LARGE_INTEGER StreamBytesTransferred,
__in DWORD dwStreamNumber,
__in DWORD dwCallbackReason,
__in HANDLE hSourceFile,
__in HANDLE hDestinationFile,
__in_opt LPVOID lpData
);
CopyProgressRoutine回调函数
一个应用程序定义的回调函数与CopyFileEx,MoveFileTransacted和MoveFileWithProgress函数中使用。当它被称为一个复制或移动操作部分已经完成。在LPPROGRESS_ROUTINE类型定义一个指向这个回调函数。 CopyProgressRoutine是一个应用程序的占位符定义函数的名称。
参数
TotalFileSize [in]
该文件的总大小,以字节为单位。
TotalBytesTransferred [in]
从源传输的文件以来的复制操作目标文件的总字节数开始。
StreamSize [in]
在当前文件流的总字节大小。
StreamBytesTransferred [in]
中的字节当前流已经从源传输的文件以来的复制操作的目标文件的总人数开始。
dwStreamNumber [in]
一个句柄,当前流。第一次CopyProgressRoutine被调用时,流数量为1。
dwCallbackReason [in]
即CopyProgressRoutine被称为原因。此参数可以是下列值之一。
ValueMeaning
CALLBACK_CHUNK_FINISHED
数据文件的0x00000000Another的一部分被复制。
CALLBACK_STREAM_SWITCH
0x00000001Another流创建并即将被复制。这是回调理由回调例程时,首先调用。
hSourceFile [in]
阿处理源文件。
hDestinationFile [in]
句柄到目标文件
lpData [中,可选]
参数传递给CopyProgressRoutine由CopyFileEx,MoveFileTransacted,或MoveFileWithProgress。
返回值
该CopyProgressRoutine函数应该返回下列值之一。
返回代码/ valueDescription
PROGRESS_CANCEL
1Cancel复制操作,并删除目标文件。
PROGRESS_CONTINUE
0Continue复制操作。
PROGRESS_QUIET
3Continue复制操作,但应停止援引CopyProgressRoutine汇报工作进度。
PROGRESS_STOP
2Stop复制操作。它可以在以后重新启动的时间。
备注
应用程序可以使用这些信息来显示进度条,显示了作为总文件大小百分之复制的总字节数。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
参见
CopyFileEx
文件管理函数
MoveFileTransacted
MoveFileWithProgress
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==CopyProgressRoutine Callback Function
An application-defined callback function used with the CopyFileEx , MoveFileTransacted , and MoveFileWithProgress functions. It is called when a portion of a copy or move operation is completed. The LPPROGRESS_ROUTINE type defines a pointer to this callback function. CopyProgressRoutine is a placeholder for the application-defined function name.
Syntax
C++
DWORD CALLBACK CopyProgressRoutine(
__in LARGE_INTEGER TotalFileSize,
__in LARGE_INTEGER TotalBytesTransferred,
__in LARGE_INTEGER StreamSize,
__in LARGE_INTEGER StreamBytesTransferred,
__in DWORD dwStreamNumber,
__in DWORD dwCallbackReason,
__in HANDLE hSourceFile,
__in HANDLE hDestinationFile,
__in_opt LPVOID lpData
);
Parameters
TotalFileSize [in]
The total size of the file, in bytes.
TotalBytesTransferred [in]
The total number of bytes transferred from the source file to the destination file since the copy operation began.
StreamSize [in]
The total size of the current file stream, in bytes.
StreamBytesTransferred [in]
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 [in]
A handle to the current stream. The first time CopyProgressRoutine is called, the stream number is 1.
dwCallbackReason [in]
The reason that CopyProgressRoutine was called. This parameter can be one of the following values.
ValueMeaning
CALLBACK_CHUNK_FINISHED
0x00000000Another part of the data file was copied.
CALLBACK_STREAM_SWITCH
0x00000001Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked.

hSourceFile [in]
A handle to the source file.
hDestinationFile [in]
A handle to the destination file
lpData [in, optional]
Argument passed to CopyProgressRoutine by CopyFileEx , MoveFileTransacted, or MoveFileWithProgress .
Return Value
The CopyProgressRoutine function should return one of the following values.
Return code/valueDescription
PROGRESS_CANCEL
1Cancel the copy operation and delete the destination file.
PROGRESS_CONTINUE
0Continue the copy operation.
PROGRESS_QUIET
3Continue the copy operation, but stop invoking CopyProgressRoutine to report progress.
PROGRESS_STOP
2Stop the copy operation. It can be restarted at a later time.

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.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
See Also
CopyFileEx
File Management Functions
MoveFileTransacted
MoveFileWithProgress
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363854(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:19:11