With MFC, you usally have
CWnd
derived classes. If you only have the handle, you can use
CWnd::FromHandle()
to get a temporary
CWnd
object.
Then use the
GetMenu() [
^] function to access the menu and iterate through it and it's sub-menus. But you should check that the window is not a child window before using
GetMenu()
.