如何在 Windows 中锁定屏幕? [英] How to lock the screen in Windows?
问题描述
通常我用 Java 开发,但现在我需要编写一个应用程序,该应用程序将每 X 分钟阻塞整个计算机的屏幕,持续 Y 分钟.它需要休息一下(我想在 Windows 中像在 Linux 中一样有一个类似的应用程序).
所以我建议我需要使用 C++ 和 User32.dll 来实现它?我对吗?(我不想用 C# 开发应用程序).任何人都可以告诉我使用哪些方法来锁定屏幕,我是 WinAPI 开发的新手.
谢谢!
Usually I develop in Java but now I need to write an app that will block the whole computer's screen every X minutes for Y minutes. It needs to make a break (I want to have a similar app in Windows like in Linux).
So I suggest I need to use C++ and User32.dll to achieve it? Am i right? (I don't want to develop an application in C#). Could anybody give me an idea which methods to use to lock the screen, I'm a newby in WinAPI developing.
Thank you!
推荐答案
只需将您的应用程序链接到 user32.dll
并调用 LockWorkStation()
直接调用.
Just link your application to user32.dll
and call the LockWorkStation()
function directly.
这篇关于如何在 Windows 中锁定屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!