一个透明窗口,忽略 wxWidgets 或任何其他 C++ 的鼠标事件。跨平台库
我想知道是否可以创建一个忽略鼠标事件的透明窗口。我的目标是创建一个“玻璃窗格”并将其放在另一个窗户上。鼠标事件应该从被覆盖的窗口接收。 这个示例可以做到这一点,但我想使用 wxWidgets 或 Qt 等 C++ 库。 我已经尝试使用这些库创建一个透明窗口,但没有成功。 有人尝试过创建具有这些功能的窗口吗? 我将不胜感激任何帮助。
I would like to know if it is possible to create a transparent window that ignores mouse events. My goal is to create a "glass pane" and put it on another window. Mouse events should be received from the covered window.
This example does it, but I would like to use a C++ library like wxWidgets or Qt.
I already tried to create a transparent window with those libraries but without success.
Has anybody tried to create a window with these features?
I'll appreciate any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以忽略鼠标事件 - 但由操作系统决定将鼠标事件发送到哪个应用程序,并且不太可能将其传播到您应用程序下方的另一个应用程序。
除非你的操作系统有一个特定的选项来执行此操作,否则除了图形驱动程序中的某种挂钩之外,以便操作系统不知道你的窗口在那里,我看不到明显的方法
You can ignore mouse events - but it's upto the OS to decide which application to send the mouse event to and it's unlikely to propogate it to another app that is underneath your app.
Unless your operating system has a specific option to do this then other than some sort of hook in the graphics driver so that the OS doesn't know your window is there I can't see an obvious way