前面准备好文件后,就需要从光盘里拷贝文件到安装目录,下面就是这个过程的界面:
实现这个过程的代码如下:
#001 static
#002 PAGE_NUMBER
#003 FilecopyPage(PINPUT_RECORD Ir)
#004 {
#006
#007 MUIdisplayPage(FILE_copY_PAGE);
#008
#009 /* Create context for the copy process */
#010 copyContext.DestinationRootPath = DestinationRootPath.Buffer;
#011 copyContext.InstallPath = InstallPath.Buffer;
#012 copyContext.TotalOperations = 0;
#013 copyContext.CompletedOperations = 0;
#014
#015 /* Create the progress bar as well */
#016 copyContext.ProgressBar = CreateProgressBar(13,
#017 26,
#018 xScreen - 13,
#019 yScreen - 20,
#020 10,
#021 24,
#022 TRUE,
#023 MUIGetString(STRING_SETUPcopYINGFILES));
#024
#025 // fit memory bars to screen width,distribute them uniform
#026 unsigned int mem_bar_width = (xScreen - 26) / 5;
#027 mem_bar_width -= mem_bar_width % 2; // make even
#028 /* ATTENTION: The following progress bars are debug stuff,which should not be translated!! */
创建分页内存使用情况的柱条。
#029 /* Create the paged pool progress bar */
#030 copyContext.MemoryBars[0] = CreateProgressBar(13,
#031 40,
#032 13 + mem_bar_width,
#033 43,
#034 13,
#035 44,
#036 FALSE,
#037 "Paged Memory");
#038
创建非分页内存使用情况的柱条。
#039 /* Create the non paged pool progress bar */
#040 copyContext.MemoryBars[1] = CreateProgressBar((xScreen / 2)- (mem_bar_width / 2),
#041 40,
#042 (xScreen / 2) + (mem_bar_width / 2),
#043 43,
#044 (xScreen / 2)- (mem_bar_width / 2),
#045 44,
#046 FALSE,
#047 "Nonpaged Memory");
#048
创建全局内存使用情况的柱条。
#049 /* Create the global memory progress bar */
#050 copyContext.MemoryBars[2] = CreateProgressBar(xScreen - 13 - mem_bar_width,
#051 40,
#052 xScreen - 13,
#053 43,
#054 xScreen - 13 - mem_bar_width,
#055 44,
#056 FALSE,
#057 "Free Memory");
#058
调用函数SetupCommitFileQueueW来进行所有文件拷贝。
#059 /* Do the file copying */
#060 SetupCommitFileQueueW(NULL,
#061 SetupFileQueue,
#062 FilecopyCallback,
#063 ©Context);
#064
#065 /* If we get here,we're done,so cleanup the queue and progress bar */
#066 SetupCloseFileQueue(SetupFileQueue);
#067 DestroyProgressBar(copyContext.ProgressBar);
#068 DestroyProgressBar(copyContext.MemoryBars[0]);
#069 DestroyProgressBar(copyContext.MemoryBars[1]);
#070 DestroyProgressBar(copyContext.MemoryBars[2]);
#071
#072 /* Go display the next page */
#073 return REGISTRY_PAGE;
#074}
原文地址:https://www.jb51.cc/react/308472.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。