Winforms' ContectionMenustrip和Chromiumwebbrowser

发布于 2025-02-03 16:57:17 字数 339 浏览 2 评论 0原文

我需要向Winforms ContextMenustrip展示,但Chromiumwebbrowser妨碍了。通过妨碍您的意思,我的意思是上下文Menustrip失去了一些重要的行为,例如处理鼠标和键盘消息的能力以及在失去焦点时自动关闭的能力,因为嵌入式浏览器都消耗了所有输入事件。一个类似的问题是在6年前问的,但有人告诉我我必须问自己的问题。因此,这是我的问题:如何在浏览器干扰的情况下显示自己的上下文Menustrip?我希望有人已经找到了解决方案,甚至可以解决这个解决方案。或者,也许是告诉韦布罗斯(Webrowser)的一种方式,即主持它的形式还有其他业务可以做他的干预是无关紧要的。

PS我的CEFSHARP库仍然是83.4.20.0版。

I need to show Winforms ContextMenuStrip but ChromiumWebBrowser gets in the way. By getting in the way I mean the ContextMenuStrip loses some of its significant behavior like the ability to process mouse and keyboard messages and auto closing when losing focus because all input events are consumed by the embedded browser. A question similar to this was asked 6 years ago but someone told me I have to ask my own question. So, here is my question: How can I show my own contextmenustrip without the browser interfering with it? I hope someone have already found a solution or even a workaround to this. Or perhaps a way to tell the webrowser that the form hosting it have some other business to do that his intervention is irrelevant.

P. S. My cefsharp library is still version 83.4.20.0.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

草莓味的萝莉 2025-02-10 16:57:17

我想我已经从我谈论过的类似问题中找到了解决方法:显示Winforms contestmentmenu contestmenu contestmenu confentsmenu confentsmenu confoctmenu collomiumwebbrowsererererserer contestmenu 。我只是简单地改进了他建议的解决方法,后来他对此进行了改进。当菜单即将打开并在菜单即将关闭时将其启用时,解决方法仍然是禁用WebBrowser 窗口句柄

请注意,我在此处将重点放在窗户的手柄上,因为我不是在谈论Chromiumwebbrowser控件的手柄,而是在Ibrowser Interface所述的手柄。我仔细阅读了WebBrowser窗口手柄,涉及四个窗口手柄:1。WebBrowsers的UserControl句柄; 2。cefbrowserwindow句柄(cefbrowserwindow是窗口的班级名称) - 前者的孩子; 3。显示网页的chrome_widgetwin_0(句柄2);和4:Chrome Legacy Window手柄(手柄3的孩子)。这是我与之合作的第三个手柄。

I guess I've found a workaround from the similar question I was talking about: Show Winforms Contextmenu over ChromiumWebBrowser. I just made a simple refinement of the workaround he have suggested which he revamped later. The workaround is still to disable the webbrowser window handle when a menu is about to open and enable it back when the menu is about to close.

Take note that I put emphasis to the window handle here because I am not talking about the handle of the chromiumwebbrowser control but the handle retured by IBrowser interface. I perused the webbrowser window handles and there are four window handles involved: 1. the webbrowsers' usercontrol handle; 2. the CefBrowserWindow handle (CefBrowserWindow is the window's class name)—child of the former; 3. the Chrome_WidgetWin_0 that displays the web page (child of handle 2); and, 4: the Chrome Legacy Window handle (child of handle 3). It is the third handle that I worked with.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文