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. Enabling Menu Items

Enabling Menu Items

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 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.
  • J Offline
    J Offline
    Jagadeesh VN
    wrote on last edited by
    #1

    Hi, I have an MDI application with views derived from CHtmlView, and my problem is with Undo,Cut, and Copy menu items under the Edit menu, which is always found disabled. Can anyone tell me how can I enable those menu items when a selection is made in the view. Thanks and Regards Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."

    R B 2 Replies Last reply
    0
    • J Jagadeesh VN

      Hi, I have an MDI application with views derived from CHtmlView, and my problem is with Undo,Cut, and Copy menu items under the Edit menu, which is always found disabled. Can anyone tell me how can I enable those menu items when a selection is made in the view. Thanks and Regards Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."

      R Offline
      R Offline
      Robert A T Kaldy
      wrote on last edited by
      #2

      Handle an ON_UPDATE_COMMAND_UI message for appropriate IDs (ID_EDIT_UNDO etc.) Robert-Antonio

      1 Reply Last reply
      0
      • J Jagadeesh VN

        Hi, I have an MDI application with views derived from CHtmlView, and my problem is with Undo,Cut, and Copy menu items under the Edit menu, which is always found disabled. Can anyone tell me how can I enable those menu items when a selection is made in the view. Thanks and Regards Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."

        B Offline
        B Offline
        bneacetp
        wrote on last edited by
        #3

        Handle each menu item in your CHTMLView derived class like: [...] ON_COMMAND(ID_EDIT_CUT, OnEditCut) ON_COMMAND(ID_EDIT_COPY, OnEditCopy) ON_COMMAND(ID_EDIT_PASTE, OnEditPaste) ON_COMMAND(ID_EDIT_SELECTALL, OnEditSelectAll) [...] Below is the implementation for each member function: void CWebView::OnEditCut() { ExecWB(OLECMDID_CUT, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); } void CWebView::OnEditCopy() { ExecWB(OLECMDID_COPY, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); } void CWebView::OnEditPaste() { ExecWB(OLECMDID_PASTE, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); } void CWebView::OnEditSelectAll() { ExecWB(OLECMDID_SELECTALL, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); } I got this code from an article somewhere, but unfortunately, I can't find where the article is again. Anyway, this should help you out. :) Happy Programming! WWW::CodeProject::BNEACETP

        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