我有一个包含在窗口中的 IWebBrowser2 的 OLE 对象。
在某些时候,我展开窗口及其 OLE 对象,我希望它在外部点击时折叠(即在网络浏览器之外的每次点击)。
我在窗口包装器上使用了 SetCapture
但由于某种原因,在捕获期间,Webbrowser 没有收到任何鼠标事件(点击、移动等...)
有什么想法\想法吗?
谢谢,
欧麦
最佳答案
引用自SetCapture
:
Sets the mouse capture to the specified window belonging to the current thread. SetCapture captures mouse input either when the mouse is over the capturing window, or when the mouse button was pressed while the mouse was over the capturing window and the button is still down. Only one window at a time can capture the mouse.
因此您不能在窗口上使用 SetCapture
来实际捕获点击。它专门用于用户单击您的窗口并将鼠标移出,同时按住按钮的情况。所以你将不得不使用另一种机制。
关于c++ - SetCapture 和 IWebBrowser2 容器的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7076869/