c++ - SetCapture 和 IWebBrowser2 容器的问题

标签 c++ windows internet-explorer winapi com

我有一个包含在窗口中的 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/

相关文章:

c++ - 哪些架构或设计模式适合此应用程序?

c# - 为windows窗体应用程序计算mysql数据库中一列的平均值

python - 子进程 check_output(['dir' ]) 有利于 Linux 二进制文件

c++ - stringify 运算符如何扩展 TABS?

c++ - 如何按多种括号类型拆分字符串但仍将括号保留在 C++ 中?

c# - 如何在 C# 中使用 Windows 服务调用 Windows 应用程序?

css - Internet Explorer z-index 错误?

html - 为什么 IE 在我的 "modal dialog"后面选择背景中的文本?

javascript - .live() 中的 jQuery .select() 在 IE7 和 IE8 上不起作用

c++ - -gcc 不支持 Wextra-semi?