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 be unable to select item(s) in menu when right-clicked

How to be unable to select item(s) in menu when right-clicked

Scheduled Pinned Locked Moved C / C++ / MFC
c++linuxtutorialquestion
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.
  • N Offline
    N Offline
    Na_Su
    wrote on last edited by
    #1

    Hello, everyone. I'd like to develop ".exe" file by using VC++ 6 SP5 with Windows XP SP1. The content is that during executing this program, when right-click is done over the icon of file or folder in Explorer, the user can't select item(s) of popup menu(context menu). This "can't select" means that item(s) such as "open" or "edit" etc, is/are disapeeared completely. Or the name of item is appeared with gray and unable to select. I read topics in "Shell Programming", but I could't find helpful topic about above method.:sigh: Is it some experienced in development? Or are someone known method? If knows, and helpful www link(s) also exist(s), I'm glad. Please tell me.

    L N 2 Replies Last reply
    0
    • N Na_Su

      Hello, everyone. I'd like to develop ".exe" file by using VC++ 6 SP5 with Windows XP SP1. The content is that during executing this program, when right-click is done over the icon of file or folder in Explorer, the user can't select item(s) of popup menu(context menu). This "can't select" means that item(s) such as "open" or "edit" etc, is/are disapeeared completely. Or the name of item is appeared with gray and unable to select. I read topics in "Shell Programming", but I could't find helpful topic about above method.:sigh: Is it some experienced in development? Or are someone known method? If knows, and helpful www link(s) also exist(s), I'm glad. Please tell me.

      L Offline
      L Offline
      lonely_life
      wrote on last edited by
      #2

      .EnableWindow(FALSE)

      1 Reply Last reply
      0
      • N Na_Su

        Hello, everyone. I'd like to develop ".exe" file by using VC++ 6 SP5 with Windows XP SP1. The content is that during executing this program, when right-click is done over the icon of file or folder in Explorer, the user can't select item(s) of popup menu(context menu). This "can't select" means that item(s) such as "open" or "edit" etc, is/are disapeeared completely. Or the name of item is appeared with gray and unable to select. I read topics in "Shell Programming", but I could't find helpful topic about above method.:sigh: Is it some experienced in development? Or are someone known method? If knows, and helpful www link(s) also exist(s), I'm glad. Please tell me.

        N Offline
        N Offline
        Na_Su
        wrote on last edited by
        #3

        >wisecrack: Thank you for answering. By the way, after posting message I looked into more information. And I found that "CMenu:CEnableMenuItem" may be right. My goal is to develop MFC project of dialog base. For example, here is a goal that when right-clicked over the icon of text file in Explorer, the item "cut" is glay. The below is the method. I created new MFC project of dialog base. (The project name is "Click".) And I added below code of "OnRButtonDown" with Class Wizard into "CClickDlg.cpp" file: === void CClickDlg::OnRButtonDown(UINT nFlags, CPoint point) { // TODO: CMenu *hMenu; CWnd* cwParent = GetParent(); DWORD dwStyle = cwParent->GetStyle(); hMenu = cwParent->GetSystemMenu(FALSE); hMenu -> EnableMenuItem(ID_EDIT_CUT, MF_GRAYED); CDialog::OnRButtonDown(nFlags, point); } === And including "afxres.h" in the first of "CClickDlg.cpp" file, I built "Click.exe" file. With "Click.exe" executing, I executed "explorer.exe" and I clicked right button over a certain text file. But the item "cut" wasn't glay. Which point of my method is wrong? If there is another good idea or programming flow, please tell me.

        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