标签:exe rpo type blog comm monit pytho import lib
1 #python 3.4 win7 2 from ctypes import * 3 from ctypes.wintypes import * 4 5 HWND_BROADCAST = 0xffff 6 WM_SYSCOMMAND = 0x0112 7 SC_MONITORPOWER = 0xF170 8 MonitorPowerOff = 2 9 SW_SHOW = 5 10 11 def main(): 12 windll.user32.PostMessageW(HWND_BROADCAST, WM_SYSCOMMAND, 13 SC_MONITORPOWER, MonitorPowerOff) 14 15 shell32 = windll.LoadLibrary("shell32.dll"); 16 shell32.ShellExecuteW(None,‘open‘, ‘rundll32.exe‘, 17 ‘USER32,LockWorkStation‘,‘‘,SW_SHOW) 18 19 if __name__ == "__main__": 20 print( "Win32 Application in python" ) 21 main()
标签:exe rpo type blog comm monit pytho import lib
原文地址:http://www.cnblogs.com/stephen2016/p/5996333.html