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. Control Bar Focus Issue [modified] [SOLVED]

Control Bar Focus Issue [modified] [SOLVED]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionannouncementlounge
5 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.
  • K Offline
    K Offline
    Kyudos
    wrote on last edited by
    #1

    I have a control bar that houses a tab control which displays 'dialogs' on each of three tabs. I want to update one of the tabs based on what happens in my main app window. I don't want to bombard my control bar with thousands of update messages everytime I do anything, so I was looking for a way to update it when it gets focus. However, I don't really want to handle a get focus message on every dialog control on the tab, just to run an update. Is there no general way to see if a control bar is 'active'? (in this case, whenever focus moves to any control on any tab on the bar). Do I have to put code in my main frame to watch for mouse clicks inside the client rect of the bar? ************************************ I reached an adequate compromise with an OnMouseActivate on my control bar tab, another OnMouseActivate in my view and a 'needs upadte' boolean member in the tab too.

    modified on Thursday, March 4, 2010 3:40 PM

    K 1 Reply Last reply
    0
    • K Kyudos

      I have a control bar that houses a tab control which displays 'dialogs' on each of three tabs. I want to update one of the tabs based on what happens in my main app window. I don't want to bombard my control bar with thousands of update messages everytime I do anything, so I was looking for a way to update it when it gets focus. However, I don't really want to handle a get focus message on every dialog control on the tab, just to run an update. Is there no general way to see if a control bar is 'active'? (in this case, whenever focus moves to any control on any tab on the bar). Do I have to put code in my main frame to watch for mouse clicks inside the client rect of the bar? ************************************ I reached an adequate compromise with an OnMouseActivate on my control bar tab, another OnMouseActivate in my view and a 'needs upadte' boolean member in the tab too.

      modified on Thursday, March 4, 2010 3:40 PM

      K Offline
      K Offline
      Kyudos
      wrote on last edited by
      #2

      OK, a combination of OnParentNotify and ModifyStyleEx(WS_EX_NOPARENTNOTIFY, 0) is doing the trick, but its a bit ugly. Now I just need to detect when the whole thing loses focus....anyone?

      K 1 Reply Last reply
      0
      • K Kyudos

        OK, a combination of OnParentNotify and ModifyStyleEx(WS_EX_NOPARENTNOTIFY, 0) is doing the trick, but its a bit ugly. Now I just need to detect when the whole thing loses focus....anyone?

        K Offline
        K Offline
        Kyudos
        wrote on last edited by
        #3

        Hmmm... OnMouseActivate might be even better...

        C 1 Reply Last reply
        0
        • K Kyudos

          Hmmm... OnMouseActivate might be even better...

          C Offline
          C Offline
          chevu
          wrote on last edited by
          #4

          hi u can us parentnotify... but why are you answering your own que? if you got the solution jst edit ur post title...

          K 1 Reply Last reply
          0
          • C chevu

            hi u can us parentnotify... but why are you answering your own que? if you got the solution jst edit ur post title...

            K Offline
            K Offline
            Kyudos
            wrote on last edited by
            #5

            I only have a partial solution - I can use OnMouseActivate to detect activation, but I also need to detect "focus" leaving the dialog / tab. I thought I could do it with TrackMouseEvent and OnMouseLeave but that doesn't work - since you get a 'dialog leave' event when any of the dialog controls are activated. When (if?) I solve it, I will modify the original post...

            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