检测Windows登录屏幕是否对VB.NET中的用户可见 [英] Detecting if Windows Login Screen is visible to user in VB.NET

查看:93
本文介绍了检测Windows登录屏幕是否对VB.NET中的用户可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿StackOverflow VB.NET成员,

Hey StackOverflow VB.NET members,

运行以下代码(锁定计算机)后,我必须应用什么代码来查看用户是否已成功登录计算机,而我所谓的锁定屏幕"已消失?

After running the following code (which locks the computer), what code must I be applying to see if the user has successfully logged into the computer and that "Lock Screen" I'd so called has disappeared?

Private Declare Function LockWorkStation Lib "user32.dll" () As Long

Private Function LockComputer()
    LockWorkStation()
End Function

我将呼叫"LockComputer",之后该怎么做以查看由该功能调用的锁定屏幕(例如2分钟后)是否消失或仍在向用户询问密码!

I will call "LockComputer", after that what do I do to see if the Lock screen so called by this function (after say 2 minutes) has disappeared or is still there asking for the password from the user!

谢谢, Akshit Soota

Thanks, Akshit Soota

推荐答案

对此进行看看:上面写着:没有可以调用的函数来确定工作站是否被锁定.

There it says: There is no function you can call to determine whether the workstation is locked.

但是:

要在用户登录时接收通知,请使用WTSRegisterSessionNotification函数接收WM_WTSSESSION_CHANGE消息.您可以使用会话通知来跟踪桌面状态,以便知道是否可以与用户进行交互.

To receive notification when the user logs in, use the WTSRegisterSessionNotification function to receive WM_WTSSESSION_CHANGE messages. You can use session notifications to track the desktop state so you know whether it is possible to interact with the user.

这篇关于检测Windows登录屏幕是否对VB.NET中的用户可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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