且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WS_EX_TRANSPARENT 和手写笔事件

更新时间:2023-02-05 23:33:05

WS_EX_TRANSPARENT 扩展窗口样式的行为 分层窗口 已记录:

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

[I]如果分层窗口具有WS_EX_TRANSPARENT扩展窗口样式,则分层窗口的形状将被忽略,鼠标事件将传递给分层窗口下方的其他窗口.>

[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".

WS_EX_TRANSPARENT的文档中提供了一种解决方法>:

要在没有这些限制的情况下实现透明度,请使用 SetWindowRgn 函数.

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