1

(this is not MFC)

I created a window which is transparent and covers the whole screen. However, I want it to be merely an overlay, not accepting any clicks or keyboard presses anywhere, only covering parts of the screen (and even there, don't accept input). It should be always on top (works so far) and should not block input to the windows below it. Is there a way to set this somewhere or a way to workaround this?

EnableWindow(hWnd, false); does not do what I want (obviously).

AyCe
  • 727
  • 2
  • 11
  • 30

1 Answers1

1

Ah, sorry for posting. Finally found it out!

WS_EX_TRANSPARENT is the style you want to add.

AyCe
  • 727
  • 2
  • 11
  • 30
  • Really? I wouldn't expect that to change the input handling *at all*. – Mark Ransom Oct 15 '14 at 22:04
  • @Mark It actually does! See here: http://stackoverflow.com/questions/6165136/ws-ex-transparent-what-does-it-actually-do – AyCe Oct 15 '14 at 22:05
  • Apparently it has some effect on hit testing, but you wouldn't know that from [the documentation](http://msdn.microsoft.com/en-us/library/windows/desktop/ff700543(v=vs.85).aspx). All it mentions is the changes in painting behavior. – Mark Ransom Oct 15 '14 at 22:11
  • @Mark Yes, it's strange indeed. Might also be the reason I searched for it quite long (before posting). – AyCe Oct 15 '14 at 22:16