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. General Programming
  3. C / C++ / MFC
  4. Vista Alt+Tab

Vista Alt+Tab

Scheduled Pinned Locked Moved C / C++ / MFC
question
10 Posts 3 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.
  • R Offline
    R Offline
    Ric Ashton
    wrote on last edited by
    #1

    My application is a modeless dialog which sits on top of the application's main window. Within the dialog is one edit control. My pointers are correct i.e., Window->Dialog->EditCtrl In XP, the Alt+Tab function of the Desktop works just fine. In Vista, the edit control does not regain focus. I am fine with sending Focus to the edit control however I am having problems with intercepting a WM_Message from the desktop when it brings my application to the foreground. Is it the Z-order, EV_WM_Message response, using GetForegroundWindow or something else? I can utilise the EvGetFocus and EvKillFocus functions but cannot distinguish between control from within the application and that which comes from the desktop. This is my first time here. Assistance would make me a regular responder to questions.

    C 1 Reply Last reply
    0
    • R Ric Ashton

      My application is a modeless dialog which sits on top of the application's main window. Within the dialog is one edit control. My pointers are correct i.e., Window->Dialog->EditCtrl In XP, the Alt+Tab function of the Desktop works just fine. In Vista, the edit control does not regain focus. I am fine with sending Focus to the edit control however I am having problems with intercepting a WM_Message from the desktop when it brings my application to the foreground. Is it the Z-order, EV_WM_Message response, using GetForegroundWindow or something else? I can utilise the EvGetFocus and EvKillFocus functions but cannot distinguish between control from within the application and that which comes from the desktop. This is my first time here. Assistance would make me a regular responder to questions.

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      I'm not sure what you need, does WM_ACTIVATEAPP[^] help?

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

      R 1 Reply Last reply
      0
      • C Code o mat

        I'm not sure what you need, does WM_ACTIVATEAPP[^] help?

        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

        R Offline
        R Offline
        Ric Ashton
        wrote on last edited by
        #3

        Tried both WM_ACTIVATE and WM_ACTIVATEAPP. I've set up a status bar at the base of the application requesting both functions to talk (acknowledge the message) to me. No response. Thanks for your response.

        R C 2 Replies Last reply
        0
        • R Ric Ashton

          Tried both WM_ACTIVATE and WM_ACTIVATEAPP. I've set up a status bar at the base of the application requesting both functions to talk (acknowledge the message) to me. No response. Thanks for your response.

          R Offline
          R Offline
          Ric Ashton
          wrote on last edited by
          #4

          I might instantiate these functions into the dialog and try letting it call the parent window with NotifyParent to refresh itself. Always good to talk to someone. Thank You Ric

          1 Reply Last reply
          0
          • R Ric Ashton

            Tried both WM_ACTIVATE and WM_ACTIVATEAPP. I've set up a status bar at the base of the application requesting both functions to talk (acknowledge the message) to me. No response. Thanks for your response.

            C Offline
            C Offline
            Code o mat
            wrote on last edited by
            #5

            Ric Ashton wrote:

            I've set up a status bar at the base of the application requesting both functions to talk (acknowledge the message) to me.

            How do you mean that?

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

            R 1 Reply Last reply
            0
            • C Code o mat

              Ric Ashton wrote:

              I've set up a status bar at the base of the application requesting both functions to talk (acknowledge the message) to me.

              How do you mean that?

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

              R Offline
              R Offline
              Ric Ashton
              wrote on last edited by
              #6

              Within C++ Object Windows TStatusBar* StatusBar; char xxx[255]; sprintf(xxx, "Keystroke C Timer = %d", RicsMasterTimer); if (::StatusBar) {::StatusBar->SetText(xxx);} The status bar is part of the application window.

              C 1 Reply Last reply
              0
              • R Ric Ashton

                Within C++ Object Windows TStatusBar* StatusBar; char xxx[255]; sprintf(xxx, "Keystroke C Timer = %d", RicsMasterTimer); if (::StatusBar) {::StatusBar->SetText(xxx);} The status bar is part of the application window.

                C Offline
                C Offline
                Code o mat
                wrote on last edited by
                #7

                Ah, you are using Object Windows (Borland, right?), i have no experience with that so i can't help you with anything specific, in VC++ i would give the WM_ACTIVATE (or WM_APPACTIVATE) message a handler in my dialog and in that handler i would set focus onto my edit control. Sorry but i don't know how that would work with OW.

                > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

                R 1 Reply Last reply
                0
                • C Code o mat

                  Ah, you are using Object Windows (Borland, right?), i have no experience with that so i can't help you with anything specific, in VC++ i would give the WM_ACTIVATE (or WM_APPACTIVATE) message a handler in my dialog and in that handler i would set focus onto my edit control. Sorry but i don't know how that would work with OW.

                  > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

                  R Offline
                  R Offline
                  Ric Ashton
                  wrote on last edited by
                  #8

                  I thank very much for your time. My application is complex and I will get through the current inconsistency between operating systems with respect to Focus and Activate. I would like to ask one more question. In older computers with sound cards, there is an instant termination of sound with two direct PlaySound statements. One might hear a click of the first sound, with the second sound being played in full. Example strcpy(bbb, ResidentDir); strcat(bbb, "\\sound\\alphabet\\cfs.wav"); //changed file structure PlaySound(bbb, NULL, SND_SYNC|SND_NODEFAULT); strcpy(bbb, ResidentDir); strcat(bbb, "\\sound\\alphabet\\ill.wav"); //I love lollipops PlaySound(bbb, NULL, SND_SYNC|SND_NODEFAULT); On newer computers with the sound card built into the motherboard, there is an accumulated delay. If the above code were to be repeated 100 times, it would take some 10 seconds for the computer to say "I love lollipops". I was curious as to whether there was a primacy on streaming or an inability to interrupt in the new configurations. Yours Ric

                  C 1 Reply Last reply
                  0
                  • R Ric Ashton

                    I thank very much for your time. My application is complex and I will get through the current inconsistency between operating systems with respect to Focus and Activate. I would like to ask one more question. In older computers with sound cards, there is an instant termination of sound with two direct PlaySound statements. One might hear a click of the first sound, with the second sound being played in full. Example strcpy(bbb, ResidentDir); strcat(bbb, "\\sound\\alphabet\\cfs.wav"); //changed file structure PlaySound(bbb, NULL, SND_SYNC|SND_NODEFAULT); strcpy(bbb, ResidentDir); strcat(bbb, "\\sound\\alphabet\\ill.wav"); //I love lollipops PlaySound(bbb, NULL, SND_SYNC|SND_NODEFAULT); On newer computers with the sound card built into the motherboard, there is an accumulated delay. If the above code were to be repeated 100 times, it would take some 10 seconds for the computer to say "I love lollipops". I was curious as to whether there was a primacy on streaming or an inability to interrupt in the new configurations. Yours Ric

                    C Offline
                    C Offline
                    Code o mat
                    wrote on last edited by
                    #9

                    I can't really help you there...do you mean the first PlaySound returns before the sound has been played and then when the second PlaySound kicks in it terminates the first sound with a "click" sound and then starts to play the new one?

                    > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

                    L 1 Reply Last reply
                    0
                    • C Code o mat

                      I can't really help you there...do you mean the first PlaySound returns before the sound has been played and then when the second PlaySound kicks in it terminates the first sound with a "click" sound and then starts to play the new one?

                      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

                      L Offline
                      L Offline
                      Luc Pattyn
                      wrote on last edited by
                      #10

                      Hi, that seems correct. If you want better sound control, the general advice is to use DirectSound. I have no experience with it though. :)

                      Luc Pattyn [Forum Guidelines] [My Articles]


                      - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                      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