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 MessageBox() kills active context menu

How MessageBox() kills active context menu

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++json
3 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.
  • C Offline
    C Offline
    casid
    wrote on last edited by
    #1

    I've noticed within my MFC application that should a MessageBox() API be invoked while the user is displaying a context menu that the menu is taken down and the MessageBox is shown. However, if a DoModal() API is called to show one of my dialogs while a context menu is being shown the menu stays up but you can no longer select from it. Its kind of frozen. How can I go about causing the context menu to go away prior to calling the DoModal() API? Is there a way to search for a visible menu and then subsequently destroy them? Any ideas or code snipits? Craig

    M 1 Reply Last reply
    0
    • C casid

      I've noticed within my MFC application that should a MessageBox() API be invoked while the user is displaying a context menu that the menu is taken down and the MessageBox is shown. However, if a DoModal() API is called to show one of my dialogs while a context menu is being shown the menu stays up but you can no longer select from it. Its kind of frozen. How can I go about causing the context menu to go away prior to calling the DoModal() API? Is there a way to search for a visible menu and then subsequently destroy them? Any ideas or code snipits? Craig

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Send WM_CANCELMODE to the menu's owner window. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.   -- Michael P. Butler in the Lounge

      C 1 Reply Last reply
      0
      • M Michael Dunn

        Send WM_CANCELMODE to the menu's owner window. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.   -- Michael P. Butler in the Lounge

        C Offline
        C Offline
        casid
        wrote on last edited by
        #3

        Thanks very much. That's just what I needed to learn. Craig

        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