The runtime program interface is shown in figureInterface Diagram,
This program has a tool bar used to display two command buttons, one is used to demonstrate how to make the button in the check state, and the other is disabled according to the status of the first button/Allow itself. (Both the check status and the allowed status are implemented through OnUpdateCommand.) In addition, there is an input box and button on the Dialog Bar, the prohibitions/permits of these two subwindows are also determined based on the button status on the toolbar. When you press the button on the Dialog Bar, the text in the input box is displayed. The first part of status bar is used to display various prompts, and the second part is used to display the current time using OnUpdateCommand. At the same time, the program demonstrates how to set command interpretation characters for menu items (will be displayed in the first part of the status bar) and how to set the prompt characters of the toolbar (displayed in a small ToolTip window ).
Generate an application:ExploitationAppWizard generates an MFC project,Legend,
And set it to Single Document InterfaceLegend,
Select toolbar, Status Bar, andReBar support,Legend
Modify menu:Use the resource editor to delete unnecessary menus and add a new pop-up menu and three sub-menus,Legend,
They are:
Name
ID
Description
Check
IDM_CHECK
SetCheck DemoSetCheck Demo
Disable
IDM_DISABLE
Disable DemoDisable Demo
ShowText on DialogBar
IDM_SHOW_TXT
ShowText on DialogB