0

I want to render graphics seemingly on top of the Windows desktop. There are a lot of solutions for rendering transparent and click-through windows. However, I want some of the rendered sprites to be clickable. How would I got about doing this?

I'm using C# on Windows and was planning to use OpenTK. If this is unfeasible please explain.

Community
  • 1
  • 1
Linus
  • 3,254
  • 4
  • 22
  • 36
  • 1
    This question is too broad. A few keywords to help out: WS_EX_LAYERED (for alpha transparency/compositing), SetLayeredWindowAttributes and/or UpdateLayeredWindow. I would prefer Direct2D or Direct3D for Windows work like this, however. I haven't tried it with an OpenGL framebuffer. – Robinson Oct 21 '15 at 10:11
  • As per the previous comment, the Windows DWM technically can do this, and has been able to since Windows NT 4. Whether or not this functionality is exposed in an easy to access way to your given frameworks is unclear. – Chris Becke Oct 21 '15 at 14:19

1 Answers1

0

No "clean" solution for this if you want it to work in semitransparent areas. The usual solution would be to determine which window lies directly beneath the clicked position and send it a synthetic click event message.

If all you're interested in is giving your window a solid shape, you can use the XShape (on X11) extension or use SetWindowRgn to cut out from the "sensitive" area of your window, which clicks will practically "fall through" to what's beneath.

datenwolf
  • 159,371
  • 13
  • 185
  • 298