启动时通知图标

发布于 2024-09-25 10:02:47 字数 254 浏览 0 评论 0原文

我试图使用 NotifyIcon 组件在 Windows 启动时制作程序的可见托盘图标。

该程序本身运行良好,并且托盘图标显示出来。

但是,当我将程序置于计算机启动时,托盘图标并不总是显示,而程序本身运行时没有任何问题,并且其主窗口可见。

这里不涉及自定义代码,所有代码都是自动生成的。

在 Windows 7 旗舰版上运行。

我该怎么做才能让托盘图标始终显示在 Windows 启动中?

I trying to make a visible tray-icon of my program in windows startup, with the NotifyIcon component.

The program itself works great and the tray-icon showing up.

But, when i placing my program in computer startup, the tray icon not always showing up, while the program itself is running without any problems, and its main window is visible.

There is no custom code involved here, all code is auto-generated.

Running on Windows 7 Ultimate.

What can i do to make the tray icon to showing up in windows startup always?

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

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

发布评论

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

评论(2

无戏配角 2024-10-02 10:02:47

在Windows启动时

如果您的意思是正在运行操作系统启动时间(例如,通过向 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 添加条目或使用服务),则该进程正在运行不同的会话,并且无法访问 UI。

如果您希望一个进程在操作系统启动时运行并且进行交互,您将需要两个应用程序:一个在启动时运行并公开某种形式的进程间通信 (IPC),两个是 UI使用第一个应用程序 IPC 与其通信的应用程序。

您还(取决于您的目标用户)可能需要考虑以下情况:(1)无人登录系统(例如无头服务器),以及(2)多个用户登录(例如远程桌面连接到共享系统) )。

过去,服务可以配置为向控制台用户的 UI 添加项目,但这在 Vista 中被阻止(因为它会打开安全漏洞)。

in windows startup

If you mean you are running a OS boot time (e.g. by adding an entry to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run or with a service) then the process is running in a different session and has no access to the UI.

If you want a process to be run on OS startup and to be interactive you will need two applications: one to run on startup and expose some form of inter-0process communications (IPC), and two a UI application that uses the first applications IPC to communicate with it.

You also (depending on your target users) may need to consider cases where (1) no-one logs on to the system (e.g. a headless server), and (2) where multiple users login (e.g. remote desktop connections to a shared system).

In the past services could be configured to add items to the console user's UI, but this was blocked in Vista (as it opened up security holes).

最美的太阳 2024-10-02 10:02:47

您可能会在隐藏的图标中找到它。在 Win7 上,单击“显示隐藏的图标”箭头,单击“自定义”并覆盖该行为。

You'll probably find it back in the hidden icons. On Win7 click the "Show hidden icons" arrow, click on Customize and override the behavior.

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