使用 VB.Net 阻止来自外部应用程序的 MsgBox
有没有办法拦截来自外部应用程序的 MsgBox() 并使用 VB.Net 阻止它?
对于此讨论,假设 MsgBox 标题是“SQL 应用程序”,消息是“SQL 错误 - 再试一次”。
我发现了一些寻找要弹出的 MsgBox(通过观察窗口标题)然后发送按键以按“确定”的示例,但我很好奇是否可以避免整个过程。否则,用户仍然会看到 MsgBox 或“闪烁”,即使这只是暂时的。
有可能避免这种情况吗?
Is there a way to intercept a MsgBox() from an external application and block it using VB.Net?
For this discussion, let's say the MsgBox Title is "SQL Application" and the Message is "SQL Error - Try Again".
I have found some examples of looking for the MsgBox to pop-up (by watching for the Window title) and then sending key(s) to press OK, but I was curious if the whole process could be avoided. Otherwise, the user still sees a MsgBox or a "flash", even if it's only temporary.
Is it possible to avoid this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,你可以采取一些绕路之类的东西(请参阅http://research.microsoft.com/en -us/projects/detours/),并为您加载到进程中的消息框编写一个绕道,但有几个问题:
1) 它只是 32 位,除非您支付专业版的费用
2) 所涉及的开发工作可能并不简单,特别是如果您没有大量内部 C/C++ 经验。我想你可以编写一个托管包装器来绕道,但这听起来也有点复杂。
3)没有专业版就不能用于商业用途。
这是您继承的应用程序吗?
Well, you could something like detours (see http://research.microsoft.com/en-us/projects/detours/), and write a detour for messagebox that you load into your process, BUT there are several issues:
1) it's 32 bit only, unless you pay for the pro version
2) the development effort involved may be non-trivial, esp if you dont have a lot of inhouse C/C++ experience. I suppose you could write a managed wrapper for detours, but that sounds kind of involved too.
3) You cant use it commercially without the pro version.
is this an app you've inherited?