WS_EX_TRANSPARENT and stylus events

≡放荡痞女 提交于 2019-12-14 00:11:24

问题


I'm setting WS_EX_TRANSPARENT flag in window with the following code:

SetWindowLong( hwnd, GWL_EXSTYLE,WS_EX_TRANSPARENT | WS_EX_COMPOSITED | WS_EX_LAYERED );

This flag make that mouse events go to windows system instead of my app. When I set this, I can't get Stylus events in hwnd window. Any way to solve that or that's not possible?


回答1:


The behavior for the WS_EX_TRANSPARENT extended window style for Layered Windows is documented:

[I]f the layered window has the WS_EX_TRANSPARENT extended window style, the shape of the layered window will be ignored and the mouse events will be passed to other windows underneath the layered window.

Note: The rules for input handling are usually the same, for all pointing devices. Whenever you read "mouse events" you can expand that to "input events from a pointing device".

One workaround is given in the documentation for WS_EX_TRANSPARENT:

To achieve transparency without these restrictions, use the SetWindowRgn function.



来源:https://stackoverflow.com/questions/31518114/ws-ex-transparent-and-stylus-events

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!