I have an ATL CMenu class that implements a popup window with several options for the user to click.

When the user clicks a menu option, that option is mapped to a command ID with an associated handler.

Is there a way I can pass the title (string text of the first entry) of the CMenu class to the command handler?

有帮助吗?

解决方案

No, the handler receives control being mapped by an identifier (WM_COMMAND's parameter) only. As soon as you have the identifier and [if] you know what menu it came from, you can locate the item of interest and read back it's text.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top