用户登录系统之前如何启动应用程序 [英] How to start the application before user login to the System

查看:593
本文介绍了用户登录系统之前如何启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想在用户登录系统之前启动应用程序.
这是一个系统任务栏应用程序.
请帮帮我.

在此先感谢您.

Hi all,

I want to start the application before user login to the system.
it''s an system tray application.
please help me out.

Thanks in advance.

推荐答案

您无法使用任务栏应用程序执行此操作,因为可以在可用任务栏时加载此类应用程序.并且这是在用户登录后发生的.但是,您可以自动执行此操作.而且,坦率地说,当没有人登录时,运行系统任务栏应用程序没有任何意义.为什么在没有任务栏时使用它?

有几种方法可以在系统负载和用户登录的不同阶段自动运行应用程序.最简单,最不可靠的方法是系统主菜单下的启动"子菜单.此菜单基于每个用户,但也可以将项目添加到所有用户"数据中.

其他方法在系统注册表中指定.

您可以考虑以下键:
You cannot do it with the tray application as such applications can be loaded when a tray is available; and this happens after a user logs in. However, you can do it automatically. And, frankly, running a system tray application makes no sense when nobody is logged in. Why using it when there is no tray?

There are several ways of running applications automatically on different phases of system load and user''s log in. The simplest and least robust way is "Startup" sub-menu under the system''s main menu. This menu is on per-user basis but items can also be added to the "All Users" data.

Other methods are prescribed in the system Registry.

You can consider keys like:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run			



有关更多信息,我推荐我的秘密武器":Sysinternals AutoRuns实用程序.下载 Sysinternals Suite : http://technet.microsoft.com/en-us/sysinternals /bb842062 [^ ](必须-无论如何!),打开AutoRun的包装并运行它.浏览所有文件夹并阅读帮助.这是所有可以自动运行应用程序和其他组件的地方的最终来源.

—SA



For more information, I recommend my "secret weapon": Sysinternals AutoRuns utility. Download Sysinternals Suite: http://technet.microsoft.com/en-us/sysinternals/bb842062[^] (must-have anyway!), unpack AutoRuns and run it. Browse all folders and read help. This is the ultimate source of all places where applications and other components could be run automatically.

—SA


带有UI的应用程序只能在用户会话中运行.您可能会考虑开发即使没有用户登录也可以运行的Windows Service.以下示例可以帮助您入门:

C#示例 [ VB.NET示例 [
Applications with a UI can only be run inside a User session. You might consider developing a Windows Service that can run even if no user is logged in. Here are some examples that might help you get started:

C# Sample[^]

VB.NET Sample[^]


如果我正在开发此程序,那么我将编写一个Windows服务,即使用户未登录,该服务也可以执行我想运行的功能.然后,我将使用任务栏应用程序来查询该服务,以便获得我需要显示给用户的任何状态,因为只有在用户登录时才需要运行该状态.作为一项额外的好处,任务栏应用程序还可以通知用户服务是否正在运行(并且可能会运行)为用户提供启动服务的选项.

您通常会在防病毒应用程序中看到这种行为.
If I were developing this, I would write a Windows service that performed the functionality that I wanted to run even if the user was not logged in. Then, I would use the tray application to interrogate the service to get whatever status I needed to be displayed to the user, as this only needs to run when the user logs in. As an added bonus, the tray application would also be able to notify the user if the service was running or not (and possibly provide an option for the user to start the service).

You will typically see this type of behaviour in anti-virus applications.


这篇关于用户登录系统之前如何启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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