You can either return a value from the menu indicating the selection choice and respond based on the value; function pointers; class message systems; or any method of your choice to get the job done.
As long as it works and leads the user to the correct area of your application.....who cares how it works, just that it does.
Technically in Windows every control or item is a window in itself and thus has all the functionality of a Window or it can have. Meaning that each can have it's own WinProc, etc, etc. You don't have to get this complicated.
Might I suggest a framework like this:
Code:
struct MenuItemStruc
{
std::string lpszText;
float x,y;
float left,top,right,bottom;
float width,height;
DWORD dwID;
};
class CMenu;
class CMenuItem
{
MenuItemStruc m_MenuItemProps;
//Possible pointers to previous and next menus
//Enables menu items to lead to pop-ups and/or can
//implement a PREV/NEXT setup
CMenu *m_pNextMenu;
CMenu *m_pPrevMenu;
//Selection ID of menu item
//Returned when this menu item has been selected
bool m_bHasFrame; //If frame is visible this is true
public:
...
...
bool Create(float x,float y,std::string lpszText,bool bHasFrame=false);
void SetText(std::string lpszText);
...
};
class CMenu
{
std::vector<CMenuItem *> m_vMenuItems;
....
....
public:
...
...
bool AddItem(CMenuItem *pItem);
bool AddItem(MenuItemStruc item);
...
...
};
That should get you started.