Windows Programming [14]-menus and menu resources (3)

Source: Internet
Author: User
Previously, we used menu and menuex to specify menu resources. I found that using menu does not have to pay attention to Case sensitivity. However, menuex must be case sensitive when using parameters! In addition, when the same functions are specified, their parameters and formats are also very different. I 'd like to know more about menuex, because its parameters are also required by WIN32API menu functions!
Menuex has four parameters: menu text, menu identifier (integer), menu format (constant: MFT _ *), and menu style (constant: MFs _*).
The last two parameters have system-defined constants. The list is as follows:
Mft_string = 0; {the menu item is a string} mft_bitmap = 4; {the menu item is replaced by an image (not tested yet)} mft_menubarbreak = $20; {change columns with broken lines} mft_menubreak = $40; {change columns} mft_ownerdraw = $100; {specified as the main menu of things; more complex menus can be drawn through wm_drawitem message application} mft_radiocheck = $200; {the dot replaces √ to indicate that mft_separator = $800; {is specified as the split line, the previously specified menu text is ignored.} mft_rightorder = $2000; {right alignment} mft_rightjustify = $4000; {displayed on the right (help location)} mfs_grayed = 3; {disabled, grayscale display} mfs_disabled = mfs_grayed; {same as above} mfs_checked = 8; {select} mfs_hilite = $80; {reversed highlight} mfs_enabled = 0; {No, this is the default and is generally usedProgramFor reverse operations prohibited} mfs_unchecked = 0; {not selected} mfs_unhilite = 0; {not reversed} mfs_default = $1000; {specified as the default, it should be similar to the default button (not tried yet), and the menu text will be displayed in bold}

  

The above similar parameters can be used to specify functions at the same time through "or" operations. Of course, the "or" of Delphi cannot be used here, but the "|" operator of C/C ++ is used. another example:

# Define idm_new 101 # define idm_open 102 # define idm_save 103 # define idm_exit 104 # define idm_cut 201 # define idm_copy 202 # define idm_paste 203 # define idm_about too many popup "& file ", 65535 begin menuitem "& New", idm_new, mft_string | mft_rightorder, mfs_default | mfs_checked | mfs_grayed menuitem "& Open", idm_open, mft_string, mfs_hilite menuitem "& Save ", idm_save menuitem separator menuitem "E & xit", idm_exit end popup "& edit", 65535 begin menuitem "Cu & T", idm_cut menuitem "& copy ", idm_copy menuitem "& Paste", idm_paste end popup "& help", 65535 begin menuitem "& about", idm_about endend

  

Display:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.