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
  1. Home
  2. The Lounge
  3. Focus

Focus

Scheduled Pinned Locked Moved The Lounge
c++architecturehelp
24 Posts 17 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.
  • L liquidplasmaflow

    Sounds like a relatively simple Win32 project... hook SetForegroundWindow; only pass the call on if the passed HWND is in the same process as the HWND returned by GetForegroundWindow.

    C Offline
    C Offline
    CPallini
    wrote on last edited by
    #9

    liquidplasmaflow wrote:

    Sounds like a relatively simple Win32 project... hook SetForegroundWindow; only pass the call on if the passed HWND is in the same process as the HWND returned by GetForegroundWindow.

    ...And in the meantime captures Christian keystrokes...(Maybe useful for Pete's researches, who knows?) :)

    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
    [my articles]

    L P 2 Replies Last reply
    0
    • C Christian Graus

      One thing I hate about windows is how applications jump up into focus. This is especially true of IE. I can't tell you how often I've typed my internet banking password into a CP window. I often am doing 5 things at once. I KNOW what they are. I don't need to be interrupted in what I am doing because some app decided it knows better than I do what I want to do next.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #10

      Dare I suggest such a thing as dwm[^] in a place such as this? ;P Really works a treat!

      Paul

      Pauliastan in The Code Project, password: byalmightybob
      How much time is left?[^]

      1 Reply Last reply
      0
      • C CPallini

        liquidplasmaflow wrote:

        Sounds like a relatively simple Win32 project... hook SetForegroundWindow; only pass the call on if the passed HWND is in the same process as the HWND returned by GetForegroundWindow.

        ...And in the meantime captures Christian keystrokes...(Maybe useful for Pete's researches, who knows?) :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        [my articles]

        L Offline
        L Offline
        liquidplasmaflow
        wrote on last edited by
        #11

        :laugh:

        1 Reply Last reply
        0
        • C Christian Graus

          One thing I hate about windows is how applications jump up into focus. This is especially true of IE. I can't tell you how often I've typed my internet banking password into a CP window. I often am doing 5 things at once. I KNOW what they are. I don't need to be interrupted in what I am doing because some app decided it knows better than I do what I want to do next.

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          S Offline
          S Offline
          Sean Cundiff
          wrote on last edited by
          #12

          Can I get an Amen! I particularly hate the fact that outlook thinks it should be on top when it starts up.

          -Sean ---- ????? ?????????

          S 1 Reply Last reply
          0
          • C Christian Graus

            One thing I hate about windows is how applications jump up into focus. This is especially true of IE. I can't tell you how often I've typed my internet banking password into a CP window. I often am doing 5 things at once. I KNOW what they are. I don't need to be interrupted in what I am doing because some app decided it knows better than I do what I want to do next.

            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #13

            "Not now, Kato, not now!" -- Jacque Clouseau

            1 Reply Last reply
            0
            • C CPallini

              liquidplasmaflow wrote:

              Sounds like a relatively simple Win32 project... hook SetForegroundWindow; only pass the call on if the passed HWND is in the same process as the HWND returned by GetForegroundWindow.

              ...And in the meantime captures Christian keystrokes...(Maybe useful for Pete's researches, who knows?) :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              [my articles]

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #14

              I'd better hope Christian doesn't get a keylogger. He'll think it's me.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              1 Reply Last reply
              0
              • D Dan Neely

                Agreed. I'd be willing to buy a utility that stopped any cross process focus stealing (that didn't have bugs of its own) in a heart beat.

                Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop. -- Matthew Faithfull

                L Offline
                L Offline
                led mike
                wrote on last edited by
                #15

                dan neely wrote:

                I'd be willing to buy a utility that stopped any cross process focus stealing (that didn't have bugs of its own) in a heart beat.

                I found one for you[^]

                led mike

                1 Reply Last reply
                0
                • C Christian Graus

                  One thing I hate about windows is how applications jump up into focus. This is especially true of IE. I can't tell you how often I've typed my internet banking password into a CP window. I often am doing 5 things at once. I KNOW what they are. I don't need to be interrupted in what I am doing because some app decided it knows better than I do what I want to do next.

                  Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                  M Offline
                  M Offline
                  Marc Clifton
                  wrote on last edited by
                  #16

                  Actually, Bush asked Homeland Security to ask Microsoft to put in this feature. It's supposed to help find terrorist activity. Marc

                  Thyme In The Country Interacx My Blog

                  1 Reply Last reply
                  0
                  • D Dan Neely

                    Agreed. I'd be willing to buy a utility that stopped any cross process focus stealing (that didn't have bugs of its own) in a heart beat.

                    Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop. -- Matthew Faithfull

                    L Offline
                    L Offline
                    leppie
                    wrote on last edited by
                    #17

                    You need DOS :)

                    xacc.ide - now with IronScheme support
                    IronScheme - 1.0 alpha 1 out now

                    1 Reply Last reply
                    0
                    • L liquidplasmaflow

                      Sounds like a relatively simple Win32 project... hook SetForegroundWindow; only pass the call on if the passed HWND is in the same process as the HWND returned by GetForegroundWindow.

                      S Offline
                      S Offline
                      Shog9 0
                      wrote on last edited by
                      #18

                      That's already been implemented (as of Windows 2000, if i recall correctly). Of course, this doesn't stop programs from stealing focus from themselves which, from the sound of it, is what CG is referring to. And frankly, it stops less and less of anything as time goes on, as there are ways around it and every program under the sun thinks it's pop-ups are so incredibly important that they must intrude upon the user at all times.

                      1 Reply Last reply
                      0
                      • S Sean Cundiff

                        Can I get an Amen! I particularly hate the fact that outlook thinks it should be on top when it starts up.

                        -Sean ---- ????? ?????????

                        S Offline
                        S Offline
                        Shog9 0
                        wrote on last edited by
                        #19

                        I particularly hate the fact that Outlook must set focus back to its main window before opening a new top-level window. Of course, that's just the tip of the iceberg - it also appears to use its own internal window manager, carefully written to act more-or-less like the standard Windows window manager except that it eats a mouseclick that gives focus to the window (so you need to click twice on any area of the window if that window doesn't currently have focus), maintains some bizarre parent-child relationship such that you can have any number of views of any number of messages, folders, etc. so long as you don't close the first one, and locks all top-level windows if any top-level window has a modal dialog open. But then, all of the Office apps do bizarre things when it comes to managing their own top-level windows. Which should tell you something: if the biggest profit center in MS can't get the Windows window manager fixed, then none of us have a prayer.

                        1 Reply Last reply
                        0
                        • C Christian Graus

                          One thing I hate about windows is how applications jump up into focus. This is especially true of IE. I can't tell you how often I've typed my internet banking password into a CP window. I often am doing 5 things at once. I KNOW what they are. I don't need to be interrupted in what I am doing because some app decided it knows better than I do what I want to do next.

                          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #20

                          My favourite is when I'm downloading a very large file and, upon finishing the download, the dialog pops up showing that it's being copied from a temporary folder to it's destination. Naturally, that's when I'm hitting the Enter key to start a new paragraph in Word which instead pushes the default Cancel button on the copy dialog. :sigh: Cheers, Drew.

                          1 Reply Last reply
                          0
                          • C Christian Graus

                            One thing I hate about windows is how applications jump up into focus. This is especially true of IE. I can't tell you how often I've typed my internet banking password into a CP window. I often am doing 5 things at once. I KNOW what they are. I don't need to be interrupted in what I am doing because some app decided it knows better than I do what I want to do next.

                            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                            D Offline
                            D Offline
                            David Crow
                            wrote on last edited by
                            #21

                            What's worse than that is when the window that is brought to the front is indeed important (e.g., error message, warning), but you've quickly dismissed it by typing.

                            "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                            1 Reply Last reply
                            0
                            • C Christian Graus

                              One thing I hate about windows is how applications jump up into focus. This is especially true of IE. I can't tell you how often I've typed my internet banking password into a CP window. I often am doing 5 things at once. I KNOW what they are. I don't need to be interrupted in what I am doing because some app decided it knows better than I do what I want to do next.

                              Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                              J Offline
                              J Offline
                              Joe Woodbury
                              wrote on last edited by
                              #22

                              I have a vague memory that they tried to get rid of this in XP. I suspect a lot of people complained. I want the OS to discern my unstated intentions are when deciding to switch focus. It should know whether doing so will irritate me or make me happy.

                              Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                              S 1 Reply Last reply
                              0
                              • J Joe Woodbury

                                I have a vague memory that they tried to get rid of this in XP. I suspect a lot of people complained. I want the OS to discern my unstated intentions are when deciding to switch focus. It should know whether doing so will irritate me or make me happy.

                                Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                                S Offline
                                S Offline
                                Shog9 0
                                wrote on last edited by
                                #23

                                Joe Woodbury wrote:

                                I have a vague memory that they tried to get rid of this in XP.

                                Yup - something to the effect that SetForegroundWindow() and kin stop working when the foreground window is owned by a different process (with some sort of exception for programs that are being launched and therefore should be able to take focus from the program that launched them). When it works, it's great - you see a little flashing taskbar button indicating the program wants your attention, but if you're busy elsewhere you just ignore it and everything keeps working. Except, of course, in apps like IE where multiple top-level windows share the same process. Apparently, making the world safe for pop-up advertisers was more important than reducing user annoyance.

                                Joe Woodbury wrote:

                                I suspect a lot of people complained.

                                Yup. And so we get a heapin' helpin' of hacks to get around it. Using AttachThreadInput() to associate your program with whoever owns the active window is a common one. The never-ending battle between users and the evil software developers who want to hurt them know better than them.

                                1 Reply Last reply
                                0
                                • C Christian Graus

                                  One thing I hate about windows is how applications jump up into focus. This is especially true of IE. I can't tell you how often I've typed my internet banking password into a CP window. I often am doing 5 things at once. I KNOW what they are. I don't need to be interrupted in what I am doing because some app decided it knows better than I do what I want to do next.

                                  Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                                  A Offline
                                  A Offline
                                  Ashley van Gerven
                                  wrote on last edited by
                                  #24

                                  I couldn't agree more - I hate this about windows! I've once *SENT* a password to someone in a chat window because I typed the password followed by ENTER but as I did so a chat window came to the forefront. Windows should be smarter than that... but somehow all the "smartness" went into making translucent form edges and 3D-flipping :doh:

                                  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