python *** 作 windows 锁屏与锁屏状态判断

python *** 作 windows 锁屏与锁屏状态判断,第1张

python *** 作 windows 锁屏与锁屏状态判断

pip install ctypes

from ctypes import *

while True:

u = windll.LoadLibrary('user32.dll')

result = u.GetForegroundWindow()

time.sleep(5)

print(result) # 0则表示锁屏

# u.LockWorkStation() 直接锁住

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/588557.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-12
下一篇 2022-04-12

发表评论

登录后才能评论

评论列表(0条)

保存