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 disable the close icon in the title bar of an MFC Dialog after dialog creation?

How to disable the close icon in the title bar of an MFC Dialog after dialog creation?

Scheduled Pinned Locked Moved C / C++ / MFC
c++comtoolstutorialquestion
9 Posts 4 Posters 1 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.
  • R Offline
    R Offline
    rbid
    wrote on last edited by
    #1

    Hello, In addition to catching the WM_CLOSE event, I would like to disable the close icon on the dialog title bar when some critical section is being parsed in my application. Is this possible?, For those that use Nero Burning Room, when you are burning a CD/DVD, the close icon on the dialog title bar is dissabled.. How can be this done under MFC? http://img82.imageshack.us/img82/1588/disableclose7uy.gif[^] I guess that the style of the window is changed with SetWindowLong(), but I don't manage to find how. Thanks in advance. -- **Ricky Marek** (_AKA: rbid_) -- "Things are only impossible until they are not" --- Jean-Luc Picard My articles

    T F H R 4 Replies Last reply
    0
    • R rbid

      Hello, In addition to catching the WM_CLOSE event, I would like to disable the close icon on the dialog title bar when some critical section is being parsed in my application. Is this possible?, For those that use Nero Burning Room, when you are burning a CD/DVD, the close icon on the dialog title bar is dissabled.. How can be this done under MFC? http://img82.imageshack.us/img82/1588/disableclose7uy.gif[^] I guess that the style of the window is changed with SetWindowLong(), but I don't manage to find how. Thanks in advance. -- **Ricky Marek** (_AKA: rbid_) -- "Things are only impossible until they are not" --- Jean-Luc Picard My articles

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      disable the related menuitem in the system menu and the button will be disabled at the same time...

      1 Reply Last reply
      0
      • R rbid

        Hello, In addition to catching the WM_CLOSE event, I would like to disable the close icon on the dialog title bar when some critical section is being parsed in my application. Is this possible?, For those that use Nero Burning Room, when you are burning a CD/DVD, the close icon on the dialog title bar is dissabled.. How can be this done under MFC? http://img82.imageshack.us/img82/1588/disableclose7uy.gif[^] I guess that the style of the window is changed with SetWindowLong(), but I don't manage to find how. Thanks in advance. -- **Ricky Marek** (_AKA: rbid_) -- "Things are only impossible until they are not" --- Jean-Luc Picard My articles

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

        Check this out :- http://www.codeguru.com/Cpp/W-D/dislog/menuhandling/article.php/c1931/[^] Regards, FarPointer

        1 Reply Last reply
        0
        • R rbid

          Hello, In addition to catching the WM_CLOSE event, I would like to disable the close icon on the dialog title bar when some critical section is being parsed in my application. Is this possible?, For those that use Nero Burning Room, when you are burning a CD/DVD, the close icon on the dialog title bar is dissabled.. How can be this done under MFC? http://img82.imageshack.us/img82/1588/disableclose7uy.gif[^] I guess that the style of the window is changed with SetWindowLong(), but I don't manage to find how. Thanks in advance. -- **Ricky Marek** (_AKA: rbid_) -- "Things are only impossible until they are not" --- Jean-Luc Picard My articles

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          GetSystemMenu(FALSE)->RemoveMenu(SC_CLOSE, MF_BYCOMMAND);

          F 1 Reply Last reply
          0
          • H Hamid Taebi

            GetSystemMenu(FALSE)->RemoveMenu(SC_CLOSE, MF_BYCOMMAND);

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

            RemoveMenu or ModifyMenu.:omg: Regards, FarPointer

            H 1 Reply Last reply
            0
            • F FarPointer

              RemoveMenu or ModifyMenu.:omg: Regards, FarPointer

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              of course Fisrt Hi FarPointer whats the problem?

              F 1 Reply Last reply
              0
              • H Hamid Taebi

                of course Fisrt Hi FarPointer whats the problem?

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

                he doesnt wants to remove it all he wants is to disable it . Regards, FarPointer

                H 1 Reply Last reply
                0
                • F FarPointer

                  he doesnt wants to remove it all he wants is to disable it . Regards, FarPointer

                  H Offline
                  H Offline
                  Hamid Taebi
                  wrote on last edited by
                  #8

                  yes (he wants only disable)

                  1 Reply Last reply
                  0
                  • R rbid

                    Hello, In addition to catching the WM_CLOSE event, I would like to disable the close icon on the dialog title bar when some critical section is being parsed in my application. Is this possible?, For those that use Nero Burning Room, when you are burning a CD/DVD, the close icon on the dialog title bar is dissabled.. How can be this done under MFC? http://img82.imageshack.us/img82/1588/disableclose7uy.gif[^] I guess that the style of the window is changed with SetWindowLong(), but I don't manage to find how. Thanks in advance. -- **Ricky Marek** (_AKA: rbid_) -- "Things are only impossible until they are not" --- Jean-Luc Picard My articles

                    R Offline
                    R Offline
                    rbid
                    wrote on last edited by
                    #9

                    It is so simple when you know it :) -- **Ricky Marek** (_AKA: rbid_) -- "Things are only impossible until they are not" --- Jean-Luc Picard My articles

                    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