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. About Active Window And Receive Msg

About Active Window And Receive Msg

Scheduled Pinned Locked Moved C / C++ / MFC
c++data-structures
3 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.
  • Y Offline
    Y Offline
    yingkou
    wrote on last edited by
    #1

    There is a MFC-Based Application,his window tree structure as below: Root Parent Window Sub-Parent Window1:Edit、ComboBox Sub-Parent Window2:Edit、ComboBox、Static Sub-Parent Window3:ListCtrl、Progress Bar Sub-Parent Window4:Check Box Child Window4-1:Edit、ComboBox Child Window4-2:Edit、ComboBox **** I want to know if user click any window(including controls) or Get Focus,which message can Root parent window receive.

    C J 2 Replies Last reply
    0
    • Y yingkou

      There is a MFC-Based Application,his window tree structure as below: Root Parent Window Sub-Parent Window1:Edit、ComboBox Sub-Parent Window2:Edit、ComboBox、Static Sub-Parent Window3:ListCtrl、Progress Bar Sub-Parent Window4:Check Box Child Window4-1:Edit、ComboBox Child Window4-2:Edit、ComboBox **** I want to know if user click any window(including controls) or Get Focus,which message can Root parent window receive.

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

      Try the NM_SETFOCUS[^] and NM_CLICK notification messages.

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > If it doesn't matter, it's antimatter.<

      1 Reply Last reply
      0
      • Y yingkou

        There is a MFC-Based Application,his window tree structure as below: Root Parent Window Sub-Parent Window1:Edit、ComboBox Sub-Parent Window2:Edit、ComboBox、Static Sub-Parent Window3:ListCtrl、Progress Bar Sub-Parent Window4:Check Box Child Window4-1:Edit、ComboBox Child Window4-2:Edit、ComboBox **** I want to know if user click any window(including controls) or Get Focus,which message can Root parent window receive.

        J Offline
        J Offline
        JohnCz
        wrote on last edited by
        #3

        Since you are using nonstandard nomenclature, please define Root Window, Sub window and Child window. What is relationship between all windows? In general message about gaining focus (by any means including mouse click) is sent to a window that is gaining focus and loosing focus. If this window is a child window, the parent does not know about what child gained focus. You have two choices: write code in the child window to notify parent window about gaining focus using custom defined message, or write windows hook that will receive messages before any window does and post a message from the hook procedure to a parent window. In both cases you would pass a handle to a window that gains focus.

        JohnCz

        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