以管理员身份运行的程序重新启动后系统托盘图标不可见

发布于 2024-07-15 20:27:48 字数 506 浏览 5 评论 0原文

我有一个最简单的应用程序形式,其中显示一个系统托盘图标并将该应用程序添加到启动项中。 应用程序是用 C# 开发的。 我希望即使在机器重新启动后也能显示托盘图标。 目前,我在使用“以管理员身份运行”运行 exe 时遇到奇怪的行为。 当我在管理员权限下使用时,计算机重新启动后图标不会出现(尽管exe仍在运行)。 我在元数据“requestedExecutionLevel level=”asInvoker” uiAccess=”false””中使用以下元数据值:

我必须使用“invoker”(而不是“管理员”),因为如果没有它,它不会将其添加为启动项。 如果我使用双击运行 exe,它工作正常(因为现在它在当前用户域而不是管理员下运行),但该 exe 将由安装程序启动,从而在系统域中启动。 任何人都可以帮我解决这个问题吗?

要么为我提供解决方案,以便它可以在以管理员身份运行时显示系统托盘图标,要么更好,如果您可以为我提供任何方式,以便我可以在当前用户域而不是管理员下启动此 Exe?

问候 苏米特·加尔格

I have a simplest form of an application, in which I am showing a SysTray Icon and adding the application in Startup items. Application is developed in C#. I want tray icon to be shown even after restart of the machine. Currently, I am facing a strange behavior while running the exe using "Run as Administrator". When I use under administrator rights , icon doesn't come after machine restart (though exe is still running). I am using following Metadata values in metadata "requestedExecutionLevel level="asInvoker" uiAccess="false"":

I had to use "invoker" (not "administrator") because it was not adding it as startup items without it. It is working fine if I run exe using double click( as now it runs under current user domain instead of administrator) but this exe would start by installer thus started in System domain. Can any one help me to sort out this issue?

Either provide me solution so that it can show Systray icon while running as administrator or better if you can provide me any way so that I can start this Exe under current user domain instead of admin?

Regards
Sumeet Garg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇纵 2024-07-22 20:27:48

我现在从另一个组件(Shell 扩展)调用 exe,该组件始终在用户域中运行。 因此,默认情况下调用的 exe 工作用户域。 感谢所有的支持。

I am calling exe now from another component (A Shell extension), which always run in user Domain. Hence the called exe working User domain by default. Thanks for all the support.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文