Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 10 tray menu behind taskbar

I have an application with an icon in the system tray.
When you right click the tray icon it shows a menu where the user can select an action.
I have found that if I have a full screen application running and then use alt + esc to get to the tray icon. Then when I right click the icon the menu will show up behind(under) 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 it is not a full screen application that is in front the menu is correctly shown on top of the taskbar. I have also testes on windows 7 where it works fine with full screen application.
I have tried with different full screen application like internet explorer, Notepad++ but the same thing happens.
I can also see that there are lots of other application like “Skype for business” and “Radeon Settings” that does the same thing.
Skype for business with menu behind taskbar: enter image description here

For the build-in windows 10 applications this works better.
The Windows Time and Language parts of the system tray will show menus on top of the taskbar with the new windows 10 layout (black)
The Windows Sound and Network icons will hide the taskbar while showing a regular right click menu, but keeping the start menu open. (This however looks a bit strange)

I have tried with the NotificationIcon sample from the windows SDK but this also does not work correctly.

So the question is what is the right way to program showing tray context menu’s for windows 10?
My code looks like this.

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 you help

like image 687
Kennet Avatar asked Jul 11 '16 11:07

Kennet


People also ask

Why is my window behind the taskbar?

If you have the Taskbar set to Autohide, this makes a maximized window slightly larger, because it stretches all the way to the bottom of the screen and if you pop the Taskbar up, then it will cover the bottom of the open window.

How do I get my system tray back?

Right-click on an empty space in your desktop taskbar and select Properties. In the Taskbar and Start Menu Properties window, find the selection labeled Notification Area and click on Customize. Click on Turn system icons on or off. If you'd like to always show all icons, turn the slider window to On.

What is the tray at the bottom of Windows 10 called?

The official name for the thingie at the bottom of the screen is the “taskbar”. The taskbar contains a variety of elements, such as the “Start Button”, a collection of “taskbar buttons”, the clock, and the “Taskbar Notification Area”.


1 Answers

It is a Windows 10 bug, that I have noticed with many applications. It is as if MS is not defining the taskbar properly. Been nearly 2 yrs with no fix... maybe in another couple.

like image 193
Joe Avatar answered Oct 12 '22 10:10

Joe