服务启动时显示到Windows登录屏幕的消息 [英] Message to Windows logon screen when services started

查看:134
本文介绍了服务启动时显示到Windows登录屏幕的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我启动Windows 8.1笔记本电脑时,我想在Windows登录屏幕上显示一条消息,以便我知道何时启动了所有服务和启动过程.除了等待几分钟,并假设所有可启动的服务都已完成,我该如何编写一个流程来查询启动完成"条件,然后更新UI?

When I boot my Windows 8.1 laptop, I want to display a message on the Windows logon screen so that I know when all services and startup processes have started. Aside from just waiting some number of minutes, with the assumption that all services that can start have done so, how can I code a process to query for a "startup complete" condition and then update the UI?

是否可以通过组策略启动脚本或在某些服务已启动"条件下触发的任务计划程序例程来检测启动完成?我应该在事件日志中查找特定消息吗?

Would detection of startup-complete be possible with a group policy startup script or a task scheduler routine that triggers on some "services started" condition? Should I look for a specific message in the Event Log?

要向登录屏幕发送消息,我想我需要编写Windows凭据提供程序,作为C#开发人员,我认为我应该考虑使用PGina?

To message the logon screen, I'm guessing I need to write a Windows Credential Provider, and as a C# developer I believe I should be looking at PGina?

在我从头开始编写代码之前,可能在某个地方已经有罐头解决方案了?

Before I start writing code from scratch, might there already be a canned solution for this somewhere?

我目前正在寻找向登录屏幕窗口7添加消息通过更新注册表项,我应该能够在警告是否可以安全登录的情况下发出警告……一旦我确定了确定该条件的方式即可.

I'm currently looking to Add message to logon screen windows 7 where by updating a registry entry I should be able to warn if it's safe to do a logon or not ... once I find out how to determine that condition.

[edit]删除了大量无关的文字,并说明了为什么要这样做.希望能回答一个简洁而集中的问题.

[edit] Removed extensive irrelevant text with reasoning about why I'm doing this. Hoping for a response to a concise and focused question.

推荐答案

是的,您需要使用凭据提供程序(CP).我对C ++和Credential Provider V1更加熟悉,因此下面的术语是从那里开始的.您可以轻松找到等效的C#代码或使用本机互操作.

Yes, you would need to use a Credential Provider (CP). I am more familiar with C++ and Credential Provider V1, so the terminology below is from there. You can easily find the equivalent C# code or use native interop.

对服务的检查必须在CP的SetSelected方法中进行.

The check for Services needs to be in the SetSelected method of the CP.

您有两个选择-

  1. 如果您正在等待Windows服务,请使用服务控制管理器以已启动"状态查询.

  1. If you are waiting for Windows Services, use the Service Control Manager to query status as "Started".

如果您在等待自己的服务,请向每个服务中添加一个就绪"事件,并从那里触发SetEvent.在凭据提供程序端,依次对每个服务使用WaitForSingleObject.很有可能某些服务会先于其他服务开始.没关系.但是,如果需要在每个服务启动时显示指示的UI,则可以在循环中使用WaitForMultipleObjects,并继续删除发出信号的事件的句柄.

If you are waiting for your own services, add a "ready" event to each of those services and trigger a SetEvent from there. On the Credential Provider end, use WaitForSingleObject for each service in sequence. It's quite possible some services will start before others. That's fine. However, if you need to show a UI indicated as each service starts, you can use WaitForMultipleObjects in a loop and keep removing the handles of events that get signaled.

这篇关于服务启动时显示到Windows登录屏幕的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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