다음을 통해 공유


사용자 인터페이스 개체 및 명령 ID

Menu items, toolbar buttons, and accelerator keys are "user-interface objects" capable of generating commands. Each such user-interface object has an ID. You associate a user-interface object with a command by assigning the same ID to the object and the command. As explained in Messages, commands are implemented as special messages. The figure "Commands in the Framework" below shows how the framework manages commands. When a user-interface object generates a command, such as ID_EDIT_CLEAR_ALL, one of the objects in your application handles the command — in the figure below, the document object's OnEditClearAll function is called via the document's message map.

Framework의 명령

프레임워크의 명령

The figure "Command Updating in the Framework" below shows how MFC updates user-interface objects such as menu items and toolbar buttons. Before a menu drops down, or during the idle loop in the case of toolbar buttons, MFC routes an update command. In the figure below, the document object calls its update command handler, OnUpdateEditClearAll, to enable or disable the user-interface object.

Framework의 명령 업데이트

프레임워크에서 명령 업데이트

참고 항목

개념

프레임워크의 메시지 및 명령