Click here to Skip to main content
15,920,053 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How can I get the Position of a menu item. I am having Menu Item ID. The reverse is possible using the API CMenu::GetMenuItemID().

Is there any API in CMenu to get the menu item position?

Thanks in advance.
Posted
Updated 14-Mar-17 14:24pm
v2

There's no direct method for that. I guess you have to iterate on the menu's items to retrieve such a info.
 
Share this answer
 
Here is an example of how someone has tried to solve it, as noted by CPallini. Note that I have not tried the code sample nor can I verify it.
Finding a menuitem from command id[^]
 
Share this answer
 
Comments
CHill60 15-Mar-17 6:18am    
You may have missed that this question is 5 years old. I think other actions on the thread (such as spam being deleted) brought this post to the front of the list. A few of us have been caught out over the last few days - myself included.
DavidCarr 21-Mar-17 21:01pm    
Nope. Still actively developing in C++ and using MFC (for better or worse). Until the tools and the products are completely dead, content online is still useful...especially as MS's is dwindling.
Further to Signor Pallini's answer you can always check the documentation[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900