翻遍了platform sdk,以下几个问题还是没解决。。1 使用setup api做安装程序,怎么能得到安装进度?使用默认的回调函数SetupDefaultQueueCallback回弹出一个对话框,感觉不好。而且也只有拷贝文件的进度,有没有办法得到总的安装进度呢?如果不能,怎么得到单个操作的进度,比如拷贝文件,修改注册表,注册dlls等的单个进度。。2 在inf文件中使用registerdlls指示符是否只能在win2k以上的版本才能用?(SetupInstallFromInfSection函数使用SPINST_REGSVR标志),sdk上说在2k上才能用,有没有人在98下试过的?3 修改注册表操作有没有回调函数通知?(SetupInstallFromInfSection函数使用SPINST_REGISTRY标志),sdk上好象没有这个通知。。
解决方案 »
- 不同的DWORD转换为IP地址为什么IP相同?
- MFC对话框编程中静态文本中字体大小的问题?
- 关于利用OPENGL实现直线、矩形、折线的橡皮筋技术的有关问题
- MFC中有带滚动条显示图片的控件吗?
- 谁知道如何把日期字符串值转化成vc里的日期控键显示出日期来?
- CView如何清屏?
- 关于Com中的内存泄漏
- VC能实现从数据库里读出的数据显示在列表控件,然后列表控件的每一行可以调用一个txt文档吗
- 为什么我写的hook键盘,只能钩 word 和浏览器,而 notebook 不行
- 在应用程序中调用ie的问题请教
- 用ntddk\src\general\setup\install列子里的程序安装网卡后,在硬件管理器里面该硬件出现惊叹号??
- 远程攻击问题,高手请进!!
After the queue has successfully committed, you will need to update registry information for the product you are installing. It is recommended that you wait until all necessary file copy operations have been successfully completed before altering registry information.
One way to update the registry is to call SetupInstallFromInfSection with the SPINST_INIFILES, SPINST_REGISTRY, or SPINST_INI2REG flags specified. These flags can be combined in one call to SetupInstallFromInfSection.The following example uses SPINST_ALL^SPINST_FILES to indicate that the function should process all of the listed operations except file operations. Since only INI, registry, and file operations are listed in the Install section, this is a shorthand method of specifying the function should process all INI and registry operations.The following example shows how to install registry information using the SetupInstallFromINFSection function.Test = SetupInstallFromINFSection (
NULL, \\Window to own any dialog boxes
\\ created
MyInf, \\INF file containing the section
MySection, \\the section to install
SPINST_ALL ^ SPINST_FILES,\\which installation operations
\\ to process
NULL, \\the relative root key
NULL, \\the source root path
0, \\copy style
NULL, \\Message handler routine
NULL, \\Context
NULL, \\Device info set
NULL \\device info data
);
In the example, OwnerWindow is NULL because only file operations generate dialog boxes, and thus a parent window is not needed. MyInf is the INF file containing the section to process. The parameter, MySection, specifies the section to be installed. The combined flags, SPINST_ALL ^ SPINST_FILES, specify which installation operations to process, in this case, all operations except file operations. The source root path is specified as "A:\".Since no copy operations are being processed, the CopyFlags, MsgHandler, Context, DeviceInfoSet, and DeviceInfoData parameters are not specified.
Included with the setup functions is a default callback routine, SetupDefaultQueueCallback, that you can use to process notifications returned by SetupCommitFileQueue.
The following sections discuss the format of the default queue callback routine, using the default queue callback routine with SetupCommitFileQueue, and how to create a filter callback routine that builds on the functionality provided by the default queue callback routine.
About the Default Queue Callback Routine
Using the Default Queue Callback Routine
Default Queue Callback Routine Reference
HWND AlternateProgressWindow和第3个参数来实现,结果,收到的消息中两个参数不是1,0就是0,0。
能不能发一份解决以后的代码呢?[email protected]
连2k中setup api的原代码都翻出来了,还是没有办法,估计是不行了。m_pContext = SetupInitDefaultQueueCallbackEx(m_hOwner,hProgress,uiProgreassMsg,0,NULL);BEGIN_MSG_MAP(CSetupPage)
MESSAGE_HANDLER(WM_UG_PROGREASS, OnProgress)
END_MSG_MAP()
LRESULT OnProgress(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if( 0 == wParam )
m_wndProgress.SetRange(0,(UINT)lParam);
else if( 1 == wParam && 0 == lParam )
m_wndProgress.SetPos( m_wndProgress.GetPos()+1 ); return S_OK;
}
wparam为0,表示lparam参数为需要拷贝文件的数量,wparam为1表示目前已拷贝了一个文件。这个进度是以文件个数做为range,每拷贝一个递增1个tick