最小化到系统托盘的含义

发布于 2024-09-17 07:29:57 字数 238 浏览 2 评论 0原文

我有一个具有多种功能的 UI 应用程序 (<800KB)。我想允许将其最小化到系统托盘,并继续解码来自串行端口的数据并发送网络消息。

我可以简单地隐藏主窗体并在系统托盘中创建一个NotifyIcon,还是系统托盘应用程序还有其他考虑因素?应用程序隐藏时使用的资源是否较少?或者最好为系统托盘制作一个轻型应用程序版本(带有重复的代码)?

我的应用程序执行两个不同应用程序执行的操作(相关功能)。我试图在完成编码之前预见其影响。

I have an UI application that serves several functions (<800KB). I wanted to allow minimizing it to the system tray, and continue to decode data coming from the serial port and sending network messages.

Can I simply hide the main form and create a NotifyIcon in the system tray, or are there other considerations for system tray applications? Does the application use less resources while hidden? Or is it best to make a light version of the application for the system tray (with duplication of code)?

My application does what 2 different applications do (related functions). I'm trying to foresee the implications before I finish coding it.

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

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

发布评论

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

评论(2

攒一口袋星星 2024-09-24 07:29:57

我编写了几个使用 NotifyIcon 的应用程序。将其放在通知区域(系统托盘)中并没有什么特别的。它只是在工具栏上不再可见。

I've written a couple apps that use NotifyIcon. Putting it in the notification area (system tray) isn't anything special. It's just not visible on the toolbar anymore.

冷…雨湿花 2024-09-24 07:29:57

IMO 在你的情况下最好的方法是创建 Windows 服务来解码串行端口的数据并发送消息。而其他 winforms 应用程序只会设置首选项和监视服务状态,可以转到托盘。也许您并不真正需要这个托盘应用程序,只需要Windows服务,您可以通过配置文件设置首选项并通过EventLog观察状态。

当然,如果可以从 Windows 服务运行,例如。您的串行端口和网络代码不需要登录的用户或桌面。

IMO best way in your case is to make windows service that will decode data from serial port and send messages. And other winforms app that will only set preferences and watch service state, that one can go to tray. Maybe you don't really need this tray app, just windows service, you can set preferences trough config file and watch state trough EventLog.

Of course if is possible to run from windows service, eg. your serial port and network code doesn't need logged user or desktop.

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