![](http://s5.picofile.com/file/8369529500/Screenshot_%DB%B2%DB%B0%DB%B1%DB%B9_%DB%B0%DB%B8_%DB%B1%DB%B3_%DB%B1%DB%B7_%DB%B4%DB%B8_%DB%B5%DB%B0.png)
![](http://s3.picofile.com/file/8369529976/Screenshot_%DB%B2%DB%B0%DB%B1%DB%B9_%DB%B0%DB%B8_%DB%B1%DB%B3_%DB%B1%DB%B7_%DB%B5%DB%B9_%DB%B5%DB%B4.png)
موارد ستاره دار مهم هستند که اگر Fail دهد جواب صفر است و اگر cchMax صفر در نظر گرفته شود تابع طول استرینگ را بر خواهد گرداند درصورتیکه که Fail ندهد یعنی مقدار برگشتی صفر نشود
***cchMax :
If nMaxCount is 0, the function returns the length of the menu string
***Return Value
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
Dim mii As MENUITEMINFOA
(mii.cbSize=Len(mii
mii.fmask=&H40 ' MIIM_STRING
mii.ftype=&H0 ' MFT_STRING
""=mii.dwTypedata
mii.cchMax=0
GetMenuItemInfo hMenu,0,True,mii
(mii.cbSize=Len(mii'
mii.fmask=&H40'
mii.fType=&H0'
(mii.dwTypedata=String$(cchMax,vbNullChar
mm.cchMax=mii.cchMax+1
GetMenuItemInfo hMenu,0,True,mii
و در آخر گرفتن کپشن با Mid
GetMenuStringA(hMenu,uIDItem,lpString, cchMax,flags)
If the specified item is not of type MIIM_STRING or
. MFT_STRING, then the return value is zero
lpString
Type: LPTSTR
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 lpStringis NULL, the function returns the length of the
.menu string
Note The GetMenuString function has been****
superseded. Use the GetMenuItemInfo function to retrieve the menu item text