Sign in to follow this  
Subconscious

Making your program not take focus?

Recommended Posts

Subconscious    136
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
ZQJ    496
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
Subconscious    136
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this