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 do I make it?

How do I make it?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++helptutorial
4 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
    MFC is the Best
    wrote on last edited by
    #1

    hello @all, i have a mdi program. in the mainframe you have for example: File -> Close i would like to hide 'Close' to the users until the correct password entered. enter password: View -> Password the 'Close' should not be gray or something like that. the user should not see that there is something like the 'Close', until he enter the right password. i hope you can help me. thank you very much MFC

    I A 2 Replies Last reply
    0
    • M MFC is the Best

      hello @all, i have a mdi program. in the mainframe you have for example: File -> Close i would like to hide 'Close' to the users until the correct password entered. enter password: View -> Password the 'Close' should not be gray or something like that. the user should not see that there is something like the 'Close', until he enter the right password. i hope you can help me. thank you very much MFC

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      Off the top of my head, you could have a ON_COMMAND_UPDATE for the mdi child (which is where the close command ends up) and use pCmdUI->SetText (m_bCanClose ? "Close" : "Password") to change the text. You would also need a command handler to change the behaviour between password entry and the normal closing. For a "proper" app, you should load the menu strings from a resource rather than hardwired as above, but you get the idea? Iain.

      M 1 Reply Last reply
      0
      • M MFC is the Best

        hello @all, i have a mdi program. in the mainframe you have for example: File -> Close i would like to hide 'Close' to the users until the correct password entered. enter password: View -> Password the 'Close' should not be gray or something like that. the user should not see that there is something like the 'Close', until he enter the right password. i hope you can help me. thank you very much MFC

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

        perhaps I misunderstood something, but the desired GUI design sounds wired.

        1 Reply Last reply
        0
        • I Iain Clarke Warrior Programmer

          Off the top of my head, you could have a ON_COMMAND_UPDATE for the mdi child (which is where the close command ends up) and use pCmdUI->SetText (m_bCanClose ? "Close" : "Password") to change the text. You would also need a command handler to change the behaviour between password entry and the normal closing. For a "proper" app, you should load the menu strings from a resource rather than hardwired as above, but you get the idea? Iain.

          M Offline
          M Offline
          MFC is the Best
          wrote on last edited by
          #4

          thanks for reply. i think i know what you mean, but i don´t know, how i should program it. can you give me an example or explain it in more detail? thank you very much mfc

          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