But after the menu display, the mouse through the menu (no other operations), click elsewhere, menu close;
Menu is closed CMenuWnd receives the WM_LBUTTONDOWN message, if the operator is not itself, is closing the menu;
The above issue tracking and found that if the mouse over the menu, will receive the WM_LBUTTONDOWN message, otherwise there won't be WM_LBUTTONDOWN message, really don't know the reason, masters teach you;
CodePudding user response:
Try to call before the popup menu SetForegroundWindowCodePudding user response:
There is another, loses focus off the menu,