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. Disable MRU file list

Disable MRU file list

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 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.
  • H Offline
    H Offline
    Haakon S
    wrote on last edited by
    #1

    I have a MDI application where I want to have only one open document at any given time. There are several different types of views, so it therefore gets confusing with many open documents as well. So, thanks to a helpfull CPian I eventually managed to block OnFileOpen() and OnFileNew() if a file is already open. But the MRU list is still active. How can I disable it if I don't want it to show up? Haakon S.

    L S 2 Replies Last reply
    0
    • H Haakon S

      I have a MDI application where I want to have only one open document at any given time. There are several different types of views, so it therefore gets confusing with many open documents as well. So, thanks to a helpfull CPian I eventually managed to block OnFileOpen() and OnFileNew() if a file is already open. But the MRU list is still active. How can I disable it if I don't want it to show up? Haakon S.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Change the call to LoadStdProfileSettings() in your application's initialisation function to LoadStdProfileSettings(0). Regards, Jason Wilden.

      H A 2 Replies Last reply
      0
      • L Lost User

        Change the call to LoadStdProfileSettings() in your application's initialisation function to LoadStdProfileSettings(0). Regards, Jason Wilden.

        H Offline
        H Offline
        Haakon S
        wrote on last edited by
        #3

        Thank you for pointing in the right direction. But I'm not entirly happy with your proposal. I want to retain the MRU list if no file is open, and to disable it only when there is an open file. Calling LoadStdProfileSettings(0) will do away with the MRU list altogether. Anyway, I've discovered that there is something called CRecentFileList::UpdateFileList(). I'll do some scruteny here. Regards, Haakon S.

        1 Reply Last reply
        0
        • L Lost User

          Change the call to LoadStdProfileSettings() in your application's initialisation function to LoadStdProfileSettings(0). Regards, Jason Wilden.

          A Offline
          A Offline
          Alexandru Savescu
          wrote on last edited by
          #4

          You could also delete it from the menu in the resource editor. Best regards, Alexandru Savescu

          1 Reply Last reply
          0
          • H Haakon S

            I have a MDI application where I want to have only one open document at any given time. There are several different types of views, so it therefore gets confusing with many open documents as well. So, thanks to a helpfull CPian I eventually managed to block OnFileOpen() and OnFileNew() if a file is already open. But the MRU list is still active. How can I disable it if I don't want it to show up? Haakon S.

            S Offline
            S Offline
            Stephen C Steel
            wrote on last edited by
            #5

            To eliminate the menu items, simply remove the ID_FILE_OPEN, ID_FILE_NEW and ID_FILE_MRU_FILE1 menu items from the the menu associated with you document template, but leave them in the default menu IDR_MAINFRAME (which is used when no document is active). You will also need to add a pair of ON_UPDATE_COMMAND_UI() handlers to your CDocument derived class to disable the ID_FILE_OPEN and ID_FILE_NEW commands when a document is active (this will prevent them being invoked via toolbar buttons or accelerator keys). When no document is active, you'll get the default behaviour (they will be enabled, since a handler function is defined). Stephen C. Steel Kerr Vayne Systems Ltd.

            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