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