6

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

Kennet
  • 323
  • 4
  • 12
  • I am facing a similar problem. Did you figure out how to fix this already? Thanks. – baldpate Dec 15 '16 at 10:03
  • No I have not found any solution. I have also written on the msdn forum. https://social.msdn.microsoft.com/Forums/en-US/b5b451cd-f908-4d99-8ddf-0bc4ef35c99b/windows-10-tray-menu-behind-taskbar?forum=windowscompatibility But the reply I got did not help. Finally I also submitted feedback on the MS feedback hub. – Kennet Dec 15 '16 at 20:41
  • @Kennet Hey. Any updates how you solved this? – semanser Feb 24 '18 at 12:24
  • Hey. No did not solve it. – Kennet Apr 17 '18 at 10:43
  • 4 years old bug and still no fix. Happens every time you use 3D acceleration, like games, or specific modelling software, and you have 150% and above font scaling enabled. This is typical scenario for designing workstations, and PCs connected to 4K TVs and monitors. Lately, it is getting pretty annoying these days, since more systems use 3D, 4K and font scaling. I don't know any way to fix the bar, other than logging in/out, or simply rebooting. – Asdf Apr 12 '19 at 14:57

3 Answers3

1

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.

Joe
  • 92
  • 4
0

This one did the trick for me in W10 when experiencing the same issue with the tray menu of catalyst control center:

  • Unlock taskbar
  • Move it to any other side of the desktop
  • Lock and Unlock taskbar
  • Place taskbar back to your preferred position and lock it

Maybe it's a client issue and not related to your code at all.

Source: http://www.thewindowsclub.com/fix-windows-7-start-menu-hides-behind-the-taskbar

Ploxl
  • 11
  • 1
0

I can confirm, that this seems to be a Windows bug which occurs randomly on my Windows 10 instance. It seems to happen when waking windows up from sleep after I docked or undocked my notebook from a docking station, where I use a different monitor setup. But it's hard to tell if this is the cause or not.

If it happens, I run a batch script with following content:

taskkill /F /IM explorer.exe
# Wait a few seconds
ping -n 3 127.0.0.1 > NUL 2>&1
start explorer.exe

This restarts Windows Explorer and all the tray menus start appearing in front of the task bar again.

ZuBsPaCe
  • 540
  • 6
  • 8