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. Disable popup menu

Disable popup menu

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 4 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
    Drawil
    wrote on last edited by
    #1

    i tried this code but it didn't work : CWnd *pMain=AfxGetMainWnd(); CMenu * pMenu=pMain->GetMenu(); CMenu * pSubMenu=pMenu->GetSubMenu(3); pSubMenu->EnableMenuItem( 1,MF_DISABLED| MF_GRAYED | MF_BYPOSITION ); in spite of this the following code is working properlly: CWnd *pMain=AfxGetMainWnd(); CMenu * pMenu=pMain->GetMenu(); pMenu->EnableMenuItem(3,MF_DISABLED| MF_GRAYED | MF_BYPOSITION ); please any help, why this happen Best Regards :)

    P M 2 Replies Last reply
    0
    • D Drawil

      i tried this code but it didn't work : CWnd *pMain=AfxGetMainWnd(); CMenu * pMenu=pMain->GetMenu(); CMenu * pSubMenu=pMenu->GetSubMenu(3); pSubMenu->EnableMenuItem( 1,MF_DISABLED| MF_GRAYED | MF_BYPOSITION ); in spite of this the following code is working properlly: CWnd *pMain=AfxGetMainWnd(); CMenu * pMenu=pMain->GetMenu(); pMenu->EnableMenuItem(3,MF_DISABLED| MF_GRAYED | MF_BYPOSITION ); please any help, why this happen Best Regards :)

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      Which menu item are trying to disable ???


      P.R.A.K.A.S.H

      A 1 Reply Last reply
      0
      • P Prakash Nadar

        Which menu item are trying to disable ???


        P.R.A.K.A.S.H

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        hi i try to disable an item like new in File->New

        1 Reply Last reply
        0
        • D Drawil

          i tried this code but it didn't work : CWnd *pMain=AfxGetMainWnd(); CMenu * pMenu=pMain->GetMenu(); CMenu * pSubMenu=pMenu->GetSubMenu(3); pSubMenu->EnableMenuItem( 1,MF_DISABLED| MF_GRAYED | MF_BYPOSITION ); in spite of this the following code is working properlly: CWnd *pMain=AfxGetMainWnd(); CMenu * pMenu=pMain->GetMenu(); pMenu->EnableMenuItem(3,MF_DISABLED| MF_GRAYED | MF_BYPOSITION ); please any help, why this happen Best Regards :)

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

          See the FAQ: 7.1 In my MFC program, I'm trying to disable a menu item with EnableMenuItem(), but it doesn't have any effect on the menu. Why?[^] --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- You cannot stop me with paramecium alone!

          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