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 hide the dialog CLOSE icon

How to hide the dialog CLOSE icon

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 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.
  • G Offline
    G Offline
    gomez_a
    wrote on last edited by
    #1

    J have an application in MFC. There is one dialog window. I want to hide the icon "close" which is inthe right upper corner of the window. What I have to do in my programm? Regards

    N 1 Reply Last reply
    0
    • G gomez_a

      J have an application in MFC. There is one dialog window. I want to hide the icon "close" which is inthe right upper corner of the window. What I have to do in my programm? Regards

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      take the properties of the dialog in resources.. in the style tab uncheck the System menu check box..;) nave

      G L 2 Replies Last reply
      0
      • N Naveen

        take the properties of the dialog in resources.. in the style tab uncheck the System menu check box..;) nave

        G Offline
        G Offline
        gomez_a
        wrote on last edited by
        #3

        Yes, I know, thank you, but I want to know how to do it in the code source. Regards

        N 1 Reply Last reply
        0
        • G gomez_a

          Yes, I know, thank you, but I want to know how to do it in the code source. Regards

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          When u want to remove the close menu. write ModifyStyle( WS_SYSMENU,0 ); nave

          1 Reply Last reply
          0
          • N Naveen

            take the properties of the dialog in resources.. in the style tab uncheck the System menu check box..;) nave

            L Offline
            L Offline
            Laxman Auti
            wrote on last edited by
            #5

            When you want the Sysmenu to be visible

            SetWindowLong(GetSafeHwnd(),GWL_STYLE,WS_SYSMENU | GetWindowLong(GetSafeHwnd(),GWL_STYLE));
            RedrawWindow(NULL, NULL,RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);

            When you don't want the Sysmenu to be visible

            SetWindowLong(GetSafeHwnd(),GWL_STYLE,~WS_SYSMENU & GetWindowLong(GetSafeHwnd(),GWL_STYLE));
            RedrawWindow(NULL, NULL,RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);

            Hope this helps you :) Knock out 'T' from CAN'T , You 'CAN' if you think you 'CAN' :cool:

            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