简体   繁体   English

右键单击不同对象时,右键单击上下文菜单的位置将更改

[英]Rightclick Context Menu Position is getting Changed on right click of different objects

I have created a ShellExtension which add " Start N Application " to the windows right click menu. 我创建了一个ShellExtension,将“ Start N Application ”添加到Windows的右键菜单。

But the problem is that , the position of the context meny is not fixed. 但是问题是,上下文的位置不是固定的。 When I rightclick on a drive , it shows up in 3 rd position , or if I rightclick on a file then it starts in the 5th position. 当我右键单击驱动器时,它会显示在第3位,或者如果我右键单击某个文件,则它将在第5位开始。 Can I make it to appear at at a particular position always. 我可以使其始终出现在特定位置吗?

The position will not just vary depending on the "registration entry point" but is also affected by the number of installed extensions and the order they were installed in. The order can probably also change based on OS version and if shift is down etc. (XP added "Pin to Startmenu" and Vista added "Copy as Path") 位置不仅会因“注册入口点”而异,还会受到已安装扩展的数量及其安装顺序的影响。该顺序还可能会根据操作系统版本以及是否降低班次等而改变(( XP添加了“ Pin to Startmenu”,而Vista添加了“ Copy as Path”

If you want it in a specific position you could ignore what IContextMenu tells you and always insert it at the top/bottom etc but this could possibly break IContextMenu hosts if they depend on the order of the menu items and not just the command id! 如果您希望将其放在特定位置,则可以忽略IContextMenu告诉您的内容,并始终将其插入顶部/底部等位置,但这可能会破坏IContextMenu主机,如果它们依赖于菜单项的顺序而不仅仅是命令ID! (And some other extension could do the same thing as you) (并且其他一些扩展程序可以与您执行相同的操作)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM