任务栏后面的Windows 10托盘菜单 [英] Windows 10 tray menu behind taskbar

查看:73
本文介绍了任务栏后面的Windows 10托盘菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Hi


我的系统托盘中有一个带有图标的应用程序。

当您右键单击托盘图标时,它会显示一个菜单,用户可以在其中选择一个操作。

我发现如果我运行全屏应用程序然后使用alt + esc来访问托盘图标。然后,当我右键单击该图标时,菜单将显示在Windows任务栏的后面(下)。

在某些情况下,菜单太低,无法选择最低的菜单项。上下文菜单。

如果它不是一个全屏应用程序,在前面菜单正确显示在任务栏的顶部,我也在Windows 7上测试它可以在全屏应用程序中正常工作。

我尝试使用不同的全屏应用程序,如Internet Explorer,Notepad ++,但同样的事情发生。

我还可以看到有很多其他应用程序,如"Skype for业务"和"Radeon设置"做同样的事情。



对于内置的Windows 10应用程序,效果更好。

系统托盘的Windows时间和语言部分将在任务栏顶部显示菜单,其中包含新窗口10布局(黑色)

Windows声音和网络图标将隐藏任务栏,同时显示常规右键单击菜单,但保持开始菜单打开。 (但这看起来有点奇怪)



我尝试过使用Windows SDK中的NotificationIcon示例,但这也无法正常工作。



所以问题是为windows 10显示托盘上下文菜单的正确方法是什么?

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 in in front the menu is correctly shown on top of the taskbar and 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.

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?


或者这是Windows 10中的一个错误?

Or is this a bug in 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

推荐答案

Hi Kennet Nielsen,

感谢您在这里发帖。

>>
我尝试过使用Windows SDK中的NotificationIcon示例,但这也无法正常工作。

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

  所以问题是为windows 10显示
托盘上下文菜单的正确方法是什么?

 So the question is what is the right way to program showing tray context menu’s for windows 10?

  对于你的情况,我建议你使用

BOOL WINAPI SetForegroundWindow(
  _In_ HWND hWnd
);

具有窗口的特定句柄,应该被激活并带到
前景。

或者使用
SetWindowPos
功能与HWND_TOP或HWND_TOPMOST。

然后使用
TrackPopupMenu
功能,带有此窗口的句柄。

如果仍然无法使用,请

连接
到Microsoft并发布问题它。

希望这可以帮到你。

最诚挚的问候,b
李旺


这篇关于任务栏后面的Windows 10托盘菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆