1

I have a layered window that I want all clicks to pass through no matter where the mouse is located. Some parts of it are color keyed, and others are not. Clicks pass through the window whenever the mouse is on a transparent part but whenever the mouse is on a non-transparent part, the window captures the click. An easy solution would be just to add the WS_EX_TRANSPARENT flag to the window but I DO NOT want to do that. I tried returning -1 on WM_NCHITTEST in WndProc since WM_NCHITTEST is called every time the mouse enters a non-transparent zone but that didn't work and clicks still didn't pass through non-color keyed areas of the window.

Thanks in advance

Cow Nation
  • 71
  • 9
  • Did you try having `WM_NCHITTEST` return `HTNOWHERE` instead? `HTTRANSPARENT` only works to send clicks to underneath windows in the same thread, not to windows in other threads/processes. And see [this article](https://devblogs.microsoft.com/oldnewthing/20121217-00/?p=5823) and [this article](https://devblogs.microsoft.com/oldnewthing/20111028-00/?p=9243) for what `WS_EX_TRANSPARENT` really is and is not. – Remy Lebeau Feb 04 '20 at 01:24
  • that didn't work – Cow Nation Feb 04 '20 at 02:15
  • Maybe related: [How to make a click-through window in C++ without WS_EX_LAYERED](https://stackoverflow.com/questions/41549147/) – Remy Lebeau Feb 04 '20 at 02:30
  • Possible duplicate: [Win32: How do I make an HWND transparent to clicks?](https://stackoverflow.com/questions/1420924/) – Remy Lebeau Feb 04 '20 at 02:32

0 Answers0