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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to disable system menu

How to disable system menu

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
6 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.
  • M Offline
    M Offline
    Manfred Staiger
    wrote on last edited by
    #1

    Hello everybody, i want to avoid the menu which pops up with a right click on the taskbar button of an application but I find no way to trap this event. Does anybody have a solution for this problem?

    MS

    CPalliniC T 2 Replies Last reply
    0
    • M Manfred Staiger

      Hello everybody, i want to avoid the menu which pops up with a right click on the taskbar button of an application but I find no way to trap this event. Does anybody have a solution for this problem?

      MS

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      The following code (though a bit ugly :rolleyes:) does the job:

      CMenu * pMenu = GetSystemMenu(FALSE);
      while ( pMenu->DeleteMenu(0, MF_BYPOSITION)) {}

      however, as side-effect, it also disables the close button at the top-right corner of the window (unfortunately I was not able to find another way... :rolleyes:). :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      M 1 Reply Last reply
      0
      • CPalliniC CPallini

        The following code (though a bit ugly :rolleyes:) does the job:

        CMenu * pMenu = GetSystemMenu(FALSE);
        while ( pMenu->DeleteMenu(0, MF_BYPOSITION)) {}

        however, as side-effect, it also disables the close button at the top-right corner of the window (unfortunately I was not able to find another way... :rolleyes:). :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        M Offline
        M Offline
        Manfred Staiger
        wrote on last edited by
        #3

        Hello cpallini, thanks a lot, that seems to work. The disabled close button does not affect my purpose.

        MS

        CPalliniC 1 Reply Last reply
        0
        • M Manfred Staiger

          Hello cpallini, thanks a lot, that seems to work. The disabled close button does not affect my purpose.

          MS

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          Your welcome :):-D:)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          In testa che avete, signor di Ceprano?

          1 Reply Last reply
          0
          • M Manfred Staiger

            Hello everybody, i want to avoid the menu which pops up with a right click on the taskbar button of an application but I find no way to trap this event. Does anybody have a solution for this problem?

            MS

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

            even you got the answer, i just wondere : why on earth do you want to remove this standard windows behaviour ?


            You don't know where to start ? ask a good friend

            [VisualCalc 3.0][Flags Beginner's Guide]

            CPalliniC 1 Reply Last reply
            0
            • T toxcct

              even you got the answer, i just wondere : why on earth do you want to remove this standard windows behaviour ?


              You don't know where to start ? ask a good friend

              [VisualCalc 3.0][Flags Beginner's Guide]

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              (At least is what I suppose...) :):-D:)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

              In testa che avete, signor di Ceprano?

              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