Home >Backend Development >Python Tutorial >python调用windows api锁定计算机示例

python调用windows api锁定计算机示例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 11:30:121009browse

调用Windows API锁定计算机

本来想用Python32直接调用,可是没有发现Python32有Windows API LockWorkStation();

因此,就直接调用Windows DLL了

代码如下:


#!/usr/bin/env python
#-*- coding:cp936 -*-

"调用WindowAPI锁定计算机"

import ctypes;

dll = ctypes.WinDLL('user32.dll');

dll.LockWorkStation();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn