SetMenuDefaultItem function

Sets the default menu item for the specified menu.

Syntax

BOOL SetMenuDefaultItem(
  HMENU hMenu,
  UINT  uItem,
  UINT  fByPos
);

Parameters

hMenu

Type: HMENU

A handle to the menu to set the default item for.

uItem

Type: UINT

The identifier or position of the new default menu item or -1 for no default item. The meaning of this parameter depends on the value of fByPos.

fByPos

Type: UINT

The meaning of uItem. If this parameter is FALSE, uItem is a menu item identifier. Otherwise, it is a menu item position. See About Menus for more information.

Return Value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, use the GetLastError function.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

GetMenuDefaultItem

Menus

Reference