User32GetMenuString(SafeHandle, UInt32, StringBuilder, Int32, MenuPosition) Method
Copies the text string of the specified menu item into the specified buffer.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
public static int GetMenuString(
SafeHandle hMenu,
uint uIDItem,
StringBuilder lpString,
int nMaxCount,
MenuPosition uFlags
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function GetMenuString (
hMenu As SafeHandle,
uIDItem As UInteger,
<OutAttribute> lpString As StringBuilder,
nMaxCount As Integer,
uFlags As MenuPosition
) As Integer
Dim hMenu As SafeHandle
Dim uIDItem As UInteger
Dim lpString As StringBuilder
Dim nMaxCount As Integer
Dim uFlags As MenuPosition
Dim returnValue As Integer
returnValue = User32.GetMenuString(hMenu,
uIDItem, lpString, nMaxCount, uFlags)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static int GetMenuString(
SafeHandle^ hMenu,
unsigned int uIDItem,
[OutAttribute] StringBuilder^ lpString,
int nMaxCount,
MenuPosition uFlags
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member GetMenuString :
hMenu : SafeHandle *
uIDItem : uint32 *
lpString : StringBuilder byref *
nMaxCount : int *
uFlags : MenuPosition -> int
No code example is currently available or this language may not be supported.
- hMenu SafeHandle
-
A handle to the menu.
- uIDItem UInt32
-
The menu item to be changed, as determined by the uFlags parameter.
- lpString StringBuilder
-
The buffer that receives the null-terminated string.
If the string is as long or longer than lpString,
the string is truncated and the terminating null character is added.
If lpString is , the function returns the length of the menu string.
- nMaxCount Int32
-
The maximum length, in characters, of the string to be copied.
If the string is longer than the maximum specified in the nMaxCount parameter,
the extra characters are truncated.
If nMaxCount is 0, the function returns the length of the menu string.
- uFlags MenuPosition
-
Indicates how the uIDItem parameter is interpreted.
Int32
If the function succeeds, the return value specifies the number of characters copied to the buffer,
not including the terminating null character.
If the function fails, the return value is zero.
If the specified item is not of type
MIIM_STRING or
MFT_STRING, then the return value is zero.