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. Displaying Context Sensitive Help Button Without Displaying The Cancel Button in the System Menu

Displaying Context Sensitive Help Button Without Displaying The Cancel Button in the System Menu

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • D Offline
    D Offline
    Dean Michaud
    wrote on last edited by
    #1

    I am trying to find a way to only display the Context Sensitive '?' button in a dialog/property sheet - I don't want the 'X' Cancel button to be displayed. When I Call this sequence... ModifyStyleEx(0, WS_EX_CONTEXTHELP); // Add The Context Help '?' ModifyStyle(WS_SYSMENU, 0); // Remove system menu to get rid of the 'X' ..it first adds the '?' to the menu, and then secondly removes the menu. This results in neither the '?' nor the 'X' being displayed. This is the only way I know of to remove the 'X' from the menu - is there a way to have it display the '?' but not the 'X', or am I stuck here? If I am stuck, my second alternative is to find a way to disable the 'X' (grey it out) so that it is not clickable... any ideas on how I go about doing that? If you have any ideas on one of both of these solutions, please let me know.

    P 1 Reply Last reply
    0
    • D Dean Michaud

      I am trying to find a way to only display the Context Sensitive '?' button in a dialog/property sheet - I don't want the 'X' Cancel button to be displayed. When I Call this sequence... ModifyStyleEx(0, WS_EX_CONTEXTHELP); // Add The Context Help '?' ModifyStyle(WS_SYSMENU, 0); // Remove system menu to get rid of the 'X' ..it first adds the '?' to the menu, and then secondly removes the menu. This results in neither the '?' nor the 'X' being displayed. This is the only way I know of to remove the 'X' from the menu - is there a way to have it display the '?' but not the 'X', or am I stuck here? If I am stuck, my second alternative is to find a way to disable the 'X' (grey it out) so that it is not clickable... any ideas on how I go about doing that? If you have any ideas on one of both of these solutions, please let me know.

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      Call GetSystemMenu on your window. Then you can call DeleteMenu on the close menu item with the SC_CLOSE ID.


      Build a man a fire, and he will be warm for a day
      Light a man on fire, and he will be warm for the rest of his life!

      D 1 Reply Last reply
      0
      • P Paul M Watt

        Call GetSystemMenu on your window. Then you can call DeleteMenu on the close menu item with the SC_CLOSE ID.


        Build a man a fire, and he will be warm for a day
        Light a man on fire, and he will be warm for the rest of his life!

        D Offline
        D Offline
        Dean Michaud
        wrote on last edited by
        #3

        Beautiful - thank you for the backup workaround for my problem! It greys out the 'X' just fine, allowing the '?' to be displayed. Hopefully there's a way to hide the 'X' altogether though, I'd much prefer that. : Dean 'Karnatos' Michaud

        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