Winapi.Messages.TWMMenuChar

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

  TWMMenuChar = record
    Msg: Cardinal;
    MsgFiller: TDWordFiller;
    User:Char;
{$IF NOT DEFINED(UNICODE)}
    Unused: Byte;
{$ENDIF}
    MenuFlag: Word; { MF_POPUP, MF_SYSMENU }
    UserMenuFlagFiller: TDWordFiller;
    Menu: HMENU;
    Result: LRESULT;
  end;

C++

struct DECLSPEC_DRECORD TWMMenuChar
{
public:
    unsigned Msg;
    System::WideChar User;
    System::Word MenuFlag;
    HMENU Menu;
    NativeInt Result;
};

Properties

Type Visibility Source Unit Parent
record
struct
public
Winapi.Messages.pas
Winapi.Messages.hpp
Winapi.Messages Winapi.Messages

Description

TWMMenuChar represents a Windows Keystroke message directed at a menu.

TWMMenuChar is the data structure used for all Windows keyboard messages that are sent to menu items. The Msg field is the Windows message code. The User field specifies the virtual key code for the key pressed by the user. This is either a character or a virtual key constant, such as VK_CANCEL. The Unused field is ignored. The MenuFlag field indicates the type of menu to which the message is directed. It should always be MF_POPUP, indicating a drop-down menu, submenu, or shortcut menu. (Earlier versions of Windows also supported MF_SYSMENU for the system menu, but the use of this flag is obsolete). The Menu field is the handle of the menu to which the message is directed. The Result field holds the value returned by the application processing the message. The following table lists the possible values and their meaning.



Value Meaning

MNC_IGNORE

Tells Windows to discard the character the user pressed and create a short beep on the system speaker.

MNC_CLOSE

Tells Windows to close the active menu.

MNC_EXECUTE

Combined with an index in the low-order word, tells Windows to choose the item specified by that index. The owner window receives a WM_COMMAND message.

MNC_SELECT

Combined with an index in the low-order word, tells Windows to select the item specified by that index.



See Also