What does boldface on a menu mean?

Date:September 29, 2004 / year-entry #352
Tags:tipssupport
Orig Link:https://blogs.msdn.microsoft.com/oldnewthing/20040929-00/?p=37713
Comments:    5
Summary:On many context menus you will see an item in boldface. For example, if you right-click a text file, you will most likely see "Open" in boldface at the top of the mean. What does the boldface mean? The boldface menu item is the default command for that menu. It represents the action that would...

On many context menus you will see an item in boldface. For example, if you right-click a text file, you will most likely see "Open" in boldface at the top of the mean. What does the boldface mean?

The boldface menu item is the default command for that menu. It represents the action that would have occurred if you had double-clicked the item instead of viewing its context menu.

In the above example, the fact that "Open" is in boldface means that if you had double-clicked the text file instead of right-clicked it, you would have opened the document.

Programmatically, the default menu item is set via the SetMenuDefaultItem function and can be retrieved with the corresponding GetMenuDefaultItem function

If you put a default menu item in a submenu, then Windows will invoke the default item in the submenu when you double-clicking the submenu's parent. But if you put a default menu item in a top-level menu (i.e., not on a submenu), then it is your responsibility to invoke the default menu item when the user double-clicks the object that led to the menu. (This last bit should be obvious: It is the code for the object being clicked on which decides what to do on a double-click.)

We'll see more about default menu commands next time.


Comments (5)
  1. brad says:

    Slightly off topic, how do you designate the default command in the registry? For example, a text file has the key

    HKEY_CLASSES_ROOTtxtfileshell

    with subkeys EditWithVS, open, print etc. The open command is the default in Explorer when a txt file is right clicked.

  2. Anon says:

    Set the default value of HKEY_CLASSES_ROOTtxtfileshell to the name of the command you want to be default.

  3. Larry says:

    I get this dialogue box-please, what does it mean?

  4. Larry says:

    I get this dialogue box-please, what does it mean?

  5. There’s a logic behind it, although not everybody follows it.

Comments are closed.


*DISCLAIMER: I DO NOT OWN THIS CONTENT. If you are the owner and would like it removed, please contact me. The content herein is an archived reproduction of entries from Raymond Chen's "Old New Thing" Blog (most recent link is here). It may have slight formatting modifications for consistency and to improve readability.

WHY DID I DUPLICATE THIS CONTENT HERE? Let me first say this site has never had anything to sell and has never shown ads of any kind. I have nothing monetarily to gain by duplicating content here. Because I had made my own local copy of this content throughout the years, for ease of using tools like grep, I decided to put it online after I discovered some of the original content previously and publicly available, had disappeared approximately early to mid 2019. At the same time, I present the content in an easily accessible theme-agnostic way.

The information provided by Raymond's blog is, for all practical purposes, more authoritative on Windows Development than Microsoft's own MSDN documentation and should be considered supplemental reading to that documentation. The wealth of missing details provided by this blog that Microsoft could not or did not document about Windows over the years is vital enough, many would agree an online "backup" of these details is a necessary endeavor. Specifics include:

<-- Back to Old New Thing Archive Index