BUG: Check Marks Missing from System Menu (269863)



The information in this article applies to:

  • Microsoft Platform Software Development Kit (SDK) 1.0, when used with:
    • Microsoft Windows 98
    • Microsoft Windows Millennium Edition

This article was previously published under Q269863

SYMPTOMS

On Windows 98 and Windows Me platforms, if the entire contents of the system menu for a window are deleted and the new nonbitmap items are added, check marks and/or radio buttons are not displayed in the menu.

CAUSE

On Windows 98 and Windows Me, space is not generated for a check mark if a bitmap is not associated with at least one of the menu items, regardless of whether or not the bitmap is used.

RESOLUTION

To completely repopulate the system menu with new items (having removed all original items), you must ensure that at least one of the items you are adding to the system menu has a bitmap associated with it.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

When a user clicks the application icon (often called the system icon) of an application window, the system menu is displayed. This menu can be accessed, modified, or reset by using the GetSystemMenu function.

If you call GetSystemMenu with the bRevert parameter, the function returns a copy of the menu, which can be modified. If you call the function with the bRevert parameter set to TRUE, the system menu is reset to its original state, and returns NULL.

The following code illustrates how to add a menu item to the system menu that has a bitmap associated with it:
//Insert a checked menu item that will ensure check marks are visible:
MENUITEMINFO mii ;
ZeroMemory(&mii, sizeof(mii)) ;
mii.cbSize = sizeof(mii) ;
mii.fMask = MIIM_STRING|MIIM_STATE|MIIM_BITMAP;
mii.dwTypeData = TEXT("test item") ;
mii.cch = lstrlen(TEXT("test item")) ;
mii.fState = MFS_CHECKED ;
mii.hbmpItem = HBMMENU_SYSTEM ;
InsertMenuItem(hmenu, 0, TRUE, &mii) ;
				

Modification Type:MinorLast Reviewed:7/11/2005
Keywords:kbBug kbMenu KB269863