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. How to call CView::OnUpdate

How to call CView::OnUpdate

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorialannouncement
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.
  • E Offline
    E Offline
    elephantstar
    wrote on last edited by
    #1

    I have a window or dialog box (class derives from CFormView) that needs to be updated when the mouse is clicking on any of the items in the menu bar or when the focus leaves the dialog box. There are two cases: (1) When there are other child windows open in the app, is there an OnKillFocus that I can call to do the update? (2) Also, when the window is the only open window in the application, and the user selects a menu item, KillFocus will not work since it's still the active window. How do I know the focus is now on the menu bar? Thanks!

    J F 2 Replies Last reply
    0
    • E elephantstar

      I have a window or dialog box (class derives from CFormView) that needs to be updated when the mouse is clicking on any of the items in the menu bar or when the focus leaves the dialog box. There are two cases: (1) When there are other child windows open in the app, is there an OnKillFocus that I can call to do the update? (2) Also, when the window is the only open window in the application, and the user selects a menu item, KillFocus will not work since it's still the active window. How do I know the focus is now on the menu bar? Thanks!

      J Offline
      J Offline
      John M Drescher
      wrote on last edited by
      #2

      Call CWnd::UpdateDialogControls and it will process all OnUpdate messages for your window. John

      1 Reply Last reply
      0
      • E elephantstar

        I have a window or dialog box (class derives from CFormView) that needs to be updated when the mouse is clicking on any of the items in the menu bar or when the focus leaves the dialog box. There are two cases: (1) When there are other child windows open in the app, is there an OnKillFocus that I can call to do the update? (2) Also, when the window is the only open window in the application, and the user selects a menu item, KillFocus will not work since it's still the active window. How do I know the focus is now on the menu bar? Thanks!

        F Offline
        F Offline
        FarPointer
        wrote on last edited by
        #3

        Hi. How do I know the focus is now on the menu bar? you can do a WM_NCHITTEST Notification it returns a ,HTMENU if its on a menu ,( the DefWindowProc function returns that ) if its an HTMENU you can do your concerned work ,i guess this might help you. Regards FarPointer.

        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