Control-Alt-Delete from python or command line

后端 未结 6 548
暖寄归人
暖寄归人 2021-01-28 14:13

I\'ve done some research but I would like to be able to call control-alt-delete from python. If that is not possible is it possible to call it from command line because then I c

6条回答
  •  鱼传尺愫
    2021-01-28 15:05

    Check out the following thread:

    • http://forums.codeguru.com/showthread.php?330557-Ctrl-alt-delete

    According to it, VNC uses something like this:

    PostMessage HWND_BROADCAST, WM_HOTKEY, 0, MakeLong(MOD_ALT Or MOD_CONTROL, VK_DELETE)
    

    I suspect you would need to use ctypes or PyWin32 to do something like this. I would probably go with ctypes since it's cross-platform, however, even with ctypes you would probably need to write a special method for each OS that you support.

提交回复
热议问题