简体   繁体   中英

CTRL+ALT+DEL not working in win32api and python

I am using python to virtually run the keyboard, using the following code for doing Ctrl + Alt + Del is not working, however, Ctrl + Shift + Tab or other key combinations are working this way. The list of hex codes I am referring is from here

import win32api
import win32con
import time

win32api.keybd_event(0xA2, 0,0,0)
time.sleep(.01)
win32api.keybd_event(0xA4, 0,0,0)
time.sleep(.01)
win32api.keybd_event(0x2E, 0,0,0)
time.sleep(.04)

win32api.keybd_event(0xA2,0 ,win32con.KEYEVENTF_KEYUP ,0)
time.sleep(.01)
win32api.keybd_event(0xA4,0 ,win32con.KEYEVENTF_KEYUP ,0)
time.sleep(.01)
win32api.keybd_event(0x2E,0 ,win32con.KEYEVENTF_KEYUP ,0)

Help from anyone would be appreciated. Using windows 7 for this purpose.

The secure attention sequence (SAS) cannot be produced by faking input. You need to call the SendSAS function.

Note that the documentation for SendSAS lists some rather severe conditions for its use. You will need to adhere carefully to these conditions in order to succeed, and this might well prove very difficult for a Python program. It make be expedient to wrap the call to SendSAS in a separate executable.

Ctrl + Alt + Del is a reserved system function in Windows for all I know. This means that the operating system will not pass the command on to your program at all.

Someone correct me on this if I'm wrong though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM