import win32com.client
import win32api
import win32con
import os
def maximizewindow():
# hack for alt+space+x
ctrl=0xa2
alt=0x12
space=0x20
X=0x58
enter=0x0d
shift=0x10
win32api.keybd_event(alt,0,0,0)
win32api.keybd_event(space,0,0,0)
time.sleep(0.3)
win32api.keybd_event(alt,0,win32con.KEYEVENTF_KEYUP,0)
win32api.keybd_event(space,0,win32con.KEYEVENTF_KEYUP,0)
time.sleep(0.5)
win32api.keybd_event(X,0,0,0)
win32api.keybd_event(X,0,win32con.KEYEVENTF_KEYUP,0)
def click(i,j):
win32api.SetCursorPos((i,j))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,i,j,0,0)
time.sleep(0.2)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,i,j,0,0)
os.chdir('C:\Program Files\Internet Explorer')
os.popen('start iexplore.exe http://192.168.1.1/')
shell = win32com.client.Dispatch("WScript.Shell")
shell.AppActivate(pid)
No comments:
Post a Comment