pip install ctypes
from ctypes import *
while True:
u = windll.LoadLibrary('user32.dll')
result = u.GetForegroundWindow()
time.sleep(5)
print(result) # 0则表示锁屏
# u.LockWorkStation() 直接锁住
欢迎分享,转载请注明来源:内存溢出
pip install ctypes
from ctypes import *
while True:
u = windll.LoadLibrary('user32.dll')
result = u.GetForegroundWindow()
time.sleep(5)
print(result) # 0则表示锁屏
# u.LockWorkStation() 直接锁住
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)