Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. protecting your window from IM windows & other popups

protecting your window from IM windows & other popups

Scheduled Pinned Locked Moved C / C++ / MFC
questiondiscussion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chasetoys
    wrote on last edited by
    #1

    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));

    M 1 Reply Last reply
    0
    • C chasetoys

      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));

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      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

      C 1 Reply Last reply
      0
      • M Michael Dunn

        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

        C Offline
        C Offline
        chasetoys
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • C chasetoys

          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

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups