I am trying to implement native Win32 menus in my app.
I am able to display and interact with the menus:
auto hMenu = CreateMenu();
auto hSubMenu = CreatePopupMenu();
#define ID_FILE_EXIT 9001
AppendMenu(hSubMenu, MF_STRING, ID_FILE_EXIT, "E&xit");
AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&File");
SetMenu(window.getSystemHandle(), hMenu);
and also able to directly receive window messages:
MSG message;
while(PeekMessage(&message, NULL, WM_COMMAND, WM_COMMAND, PM_REMOVE)) {
//do_stuff();
}
but I never receive any WM_COMMAND messages that the menus should be sending out. (if I change both the WM_COMMAND in the PeekMessage call to 0, I get mouse etc events, but asking for only WM_COMMAND gives me nothing)
I am not very experienced with the Win32 api, so I am not sure if I am using the wrong method for WM_COMMAND messages, or if somehow SFML is eating the message before I can see it. I am doing the PeekMessage stuff before my SFML event handler, if that matters.