Jump to content
  • Advertisement
Sign in to follow this  
Subconscious

Making your program not take focus?

This topic is 4699 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know of a way to make a window not take focus when you click it in C++ or C#? I've been up all night googling and playing with windows functions and playing with windows messages. Closest I could come was catching the WM_MOUSEACTIVATE message and returning MA_NOACTIVATE to it, then using SetForegroundWindow to restore focus to the old window (my window doesn't take focus but the old window still loses focus). The problem is that it causes an annoying flicker between windows when you click. I'm sure this is possible because I've seen another program do it and it's driving me slowly insane. If anyone has any ideas, I'd love to hear them.

Share this post


Link to post
Share on other sites
Advertisement
EnableWindow may do what you want. Otherwise try overriding WM_NCHITTEST. Otherwise, I'm not sure. Oh for the source code to DefWindowProc... (you could try the Wine version though).

Share this post


Link to post
Share on other sites
Just tried EnableWindow false... Same thing happen with not switching focus to my window but still killing the focus of the previous window.

Already tried overriding WM_NCHITTEST to give HTTRANSPARENT of HTNOWHERE all the time, same results as EnableWindow false.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!