如何在自定义操作中检查取消按钮而不执行任何其他操作

发布于 2024-09-01 14:20:33 字数 214 浏览 1 评论 0原文

我知道当我使用 ::MsiProcessMessage(hModule, INSTALLMESSAGE(INSTALLMESSAGE_INFO), ...); 将某些内容放入日志中时,我可以检查返回值是否为 IDCANCEL 并将 ERROR_INSTALL_USEREXIT 返回到 Windows 安装程序。

如何检查该返回值,而无需在日志中添加某些内容或更改进度条?

I know when I put something in the log using ::MsiProcessMessage(hModule, INSTALLMESSAGE(INSTALLMESSAGE_INFO), ...); that I can check if the return value is IDCANCEL and return ERROR_INSTALL_USEREXIT to Windows installer.

How do I check for that return value without having to put something in the log or alter the progress bar?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦罢 2024-09-08 14:20:33

我相信您描述的调用会将信息消息放入日志中。但除此之外,为什么您必须在日志中添加某些内容或更改进度条?如果您的操作需要很长时间,它应该报告进度。如果它很短并且您从不调用 MsiProcessMesssage,Windows Installer 将随后立即处理取消。唯一的问题情况是,如果您调用 MsiProcessMessage 并吞下取消而不报告它。

I believe the call you describe will place the info message in the log. But other than that, why would you have to put something in the log or alter the progress bar? If your action takes a long time, it should report progress. If it is short and you never call MsiProcessMesssage, Windows Installer will handle cancel immediately afterward. The only problem case is if you call MsiProcessMessage and swallow a cancel without reporting it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文