问题
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