Win32: How do I make an HWND transparent to clicks?

丶灬走出姿态 提交于 2020-07-10 04:08:50

问题


I want an HWND that is transparent to clicks (i.e. passes them through to windows underneath).

At first I tried WS_EX_TRANSPARENT but that has all sorts of redraw problems. Windows underneath end up drawing over my HWND.

I did some searching and found a suggestion to respond to WM_NCHITTEST by returning HTTRANSPARENT. This seemed to work but MSDN states that it only works correctly when the windows underneath are in the same thread. Searching for HTTTRANSPARENT turned up some problems (http://www.virtualdub.org/blog/pivot/entry.php?id=147)

So...any other ideas?


回答1:


Catch all mouse messages and forward them to the underlying window with PostMessage.



来源:https://stackoverflow.com/questions/1420924/win32-how-do-i-make-an-hwnd-transparent-to-clicks

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