user2462027
user2462027

Reputation: 353

How to make a click-through window in C++ without WS_EX_LAYERED

I'm trying to create a custom crosshair for a game called overwatch. My current solution is to create a topmost window that sits above the game while it plays using WS_EX_LAYERED, but WS_EX_LAYERED has such a huge performance hit to the game that I've decided it's an unviable solution. Are there any other ways I can make my tiny 4x4 pixel window click-through? (I already tried handling WM_NCHITTEST and returning HTTRANSPARENT/HTNOWHERE, both don't result in properly clicking through the window since it still takes the focus off of the window underneath.)

Upvotes: 2

Views: 1602

Answers (1)

Ben
Ben

Reputation: 35613

You can use a Region window for this:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd145102(v=vs.85).aspx

Upvotes: 1

Related Questions