protecting your window from IM windows & other popups
-
Hey everyone: I want the user to choose when they close down my application, so I listen for user input... but these pesky IM windows always interrupt my app and steal focus. I've tried not responding to the following messages.... then I tried what you'll see below. I thought by handling them I'd be OK... but IM windows (from Gaim for instance) totally kills focus of my program. Thoughts? Thanks! case WM_KILLFOCUS: case WM_QUIT: case WM_CLOSE: case WM_DESTROY: return(DefWindowProc(hWnd, message, wParam, lParam));
-
Hey everyone: I want the user to choose when they close down my application, so I listen for user input... but these pesky IM windows always interrupt my app and steal focus. I've tried not responding to the following messages.... then I tried what you'll see below. I thought by handling them I'd be OK... but IM windows (from Gaim for instance) totally kills focus of my program. Thoughts? Thanks! case WM_KILLFOCUS: case WM_QUIT: case WM_CLOSE: case WM_DESTROY: return(DefWindowProc(hWnd, message, wParam, lParam));
You can't prevent your window from losing focus to something else. Imagine if two programs did this - they would constantly be fighting over which one is the active window. What is it about your app that makes you want to prevent other windows from being active?
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
You can't prevent your window from losing focus to something else. Imagine if two programs did this - they would constantly be fighting over which one is the active window. What is it about your app that makes you want to prevent other windows from being active?
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
I can imagine the problem you describe. However I've seen some applications deal with it, and not yield control. I'm building a simple screensaver which I think shouldn't be interrupted by such trivial things as IM windows. You still hear the noise afterall. So I *know* there is a way, because I've seen programs that don't change focus when another window requests it. So how do you do it? :P
-
I can imagine the problem you describe. However I've seen some applications deal with it, and not yield control. I'm building a simple screensaver which I think shouldn't be interrupted by such trivial things as IM windows. You still hear the noise afterall. So I *know* there is a way, because I've seen programs that don't change focus when another window requests it. So how do you do it? :P
Well, a screen saver is a special case (in NT at least). The screen saver runs on its own desktop, so it will be the only window visible no matter what, because the interactive desktop won't be visible.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ