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. A window never get focus?

A window never get focus?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
6 Posts 4 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.
  • U Offline
    U Offline
    uniqueworld
    wrote on last edited by
    #1

    How can I make my app not get focus like On-Screen keyboard in XP. I try to use WM_MOUSEACTIVATE with return value MA_NOACTIVATE but I can't.When I click button in my dialog,it activates.So i can't send key events to other applications(I use SendInput). Please help me.

    B T 2 Replies Last reply
    0
    • U uniqueworld

      How can I make my app not get focus like On-Screen keyboard in XP. I try to use WM_MOUSEACTIVATE with return value MA_NOACTIVATE but I can't.When I click button in my dialog,it activates.So i can't send key events to other applications(I use SendInput). Please help me.

      B Offline
      B Offline
      bikram singh
      wrote on last edited by
      #2

      Information not enough for a good answer. 1. Use EnableWindow(hwnd,FALSE) to disable any mouse or kbd input to the window. This is the only suggestion as of now... Bikram Singh

      1 Reply Last reply
      0
      • U uniqueworld

        How can I make my app not get focus like On-Screen keyboard in XP. I try to use WM_MOUSEACTIVATE with return value MA_NOACTIVATE but I can't.When I click button in my dialog,it activates.So i can't send key events to other applications(I use SendInput). Please help me.

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        if you want the focus to bet set at the creation of your dialog, call Cwnd::SetFocus() into OnInitDialog() and make this function return **TRUE**. if you just need to set the focus on a control when doing someting into the dialog, just call SetFocus().


        TOXCCT >>> GEII power

        B 1 Reply Last reply
        0
        • T toxcct

          if you want the focus to bet set at the creation of your dialog, call Cwnd::SetFocus() into OnInitDialog() and make this function return **TRUE**. if you just need to set the focus on a control when doing someting into the dialog, just call SetFocus().


          TOXCCT >>> GEII power

          B Offline
          B Offline
          Behzad Ebrahimi
          wrote on last edited by
          #4

          I think that you must call SetFocus in WM_SETFOCUS and pass its lparam to SetFocus! Is that right?:confused:

          T 1 Reply Last reply
          0
          • B Behzad Ebrahimi

            I think that you must call SetFocus in WM_SETFOCUS and pass its lparam to SetFocus! Is that right?:confused:

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            :~ WM_SETFOCUS is a message, not a function. moreover, you can call SetFocus() anywhere (in a handler you created for example)


            TOXCCT >>> GEII power

            B 1 Reply Last reply
            0
            • T toxcct

              :~ WM_SETFOCUS is a message, not a function. moreover, you can call SetFocus() anywhere (in a handler you created for example)


              TOXCCT >>> GEII power

              B Offline
              B Offline
              Behzad Ebrahimi
              wrote on last edited by
              #6

              It is right, WM_SETFOCUS is a message. When a window receive this message, it can reject its focus by calling SetFocus!

              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