开发者

Capturing ShowWindow event in .Net code

开发者 https://www.devze.com 2023-03-16 06:54 出处:网络
Does anyone know how to capture an ShowWindow api call in a .NET form? We have an external VB6 program calling ShowWindow to minimize all our .NET forms in a second app. I\'d like to be able to add s

Does anyone know how to capture an ShowWindow api call in a .NET form?

We have an external VB6 program calling ShowWindow to minimize all our .NET forms in a second app. I'd like to be able to add some sort of event handler to know when the message is received by the .NET form so I can decide whether to ignore it. The fundamental problem is that when you have a modal child window open in .NET and the ShowWindow api is called and minimizes the parent and child form, it closes the modal child window. This is bad.

Using normal .NET form event handling 开发者_如何学编程(in the Resize, FormClosing, etc. is too late and any handling done there does not stop the modal window from closing, contrary to what you might think.


See Windows Hooks in the .NET Framework

0

精彩评论

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