I have an application with a system tray icon.
When you right-click on the tray icon, you will see a menu in which the user can select an action.
I found that if I have a full-screen application running, then use alt + esc to go to the tray icon. Then, when I right-click the icon, the menu will be displayed behind (at the bottom) of the Windows taskbar.
In some cases, the menu is so low that it is not possible to select the lowest menu item in the context menu.
When this is not the full-screen application that is in front, the menu displays correctly on top of the taskbar. I also have tests on Windows 7 where it works great with a full-screen application.
I tried using various full-screen applications such as Internet Explorer, Notepad ++, but the same thing happens. I also see that there are many other applications, such as Skype for Business and Radeon Settings, that do the same.
Skype for Business with a menu behind the taskbar: <w> For embedded Windows 10 applications, this works better. In the "Windows Time and Language" section of the taskbar, menus are displayed on top of the taskbar with a new Windows 10 layout (black) Windows Sound and Network icons hide the taskbar, showing the normal right-click menu, but keeping the menu open. (This looks a little strange) I tried with the NotificationIcon example from the SDK window, but it also does not work correctly.
So, the question is, how to program the display of context menus for Windows 10?
My code is as follows.
case WM_RBUTTONDOWN:
{
SetForegroundWindow();
CMenu menu;
menu.LoadMenu(ID_TRAY_MENU_SHOW_APP);
CMenu* pPopup = menu.GetSubMenu ( 0 ) ;
GetCursorPos ( &pt ) ;
pPopup->TrackPopupMenu ( TPM_LEFTALIGN | TPM_RIGHTBUTTON,pt.x, pt.y, this );
}
thanks for the help
source
share