开发者

Block MsgBox From External Application Using VB.Net

开发者 https://www.devze.com 2023-01-19 07:12 出处:网络
Is there a way to intercept a MsgBox() from an external application and block it using VB.Net? For this开发者_Go百科 discussion, let\'s say the MsgBox Title is \"SQL Application\" and the Message is

Is there a way to intercept a MsgBox() from an external application and block it using VB.Net?

For this开发者_Go百科 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?


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号