Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SetMenuDefaultItem function

Sets the default menu item for the specified menu.

Syntax


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

Parameters

hMenu [in]

Type: HMENU

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

uItem [in]

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 [in]

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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
GetMenuDefaultItem
Conceptual
Menus

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.