Example #1
0
def win_conrrol():   #windows窗口控制
    '''窗口操作使用autoit调用autoit.Properties下方法,如下'''
    autoit.win_set_state(u"PIE(教学版)", autoit.autoit.Properties.SW_HIDE)      #窗口隐藏
    sleep(2)
    autoit.win_set_state(u"PIE(教学版)", autoit.autoit.Properties.SW_SHOW)      #窗口显示
    sleep(2)
    autoit.win_set_state(u"PIE(教学版)", autoit.autoit.Properties.SW_MINIMIZE)  #窗口最小化
    sleep(2)
    autoit.win_set_state(u"PIE(教学版)", autoit.autoit.Properties.SW_MAXIMIZE)  #窗口最大化
    sleep(3)
    '''使用from...autoit import Properties后直接使用,如下'''
Example #2
0
 def setState(self, flag):
     '''
     :description 显示,隐藏,最小化,最大化或还原一个窗口.
     :param flag: The "show" flag of the executed program:
     1 = 显示
     2 = 最小化/隐藏
     3 = 最大化
     4 = 还原
     :return 1:成功, 0:失败(窗口不存在).
     '''
     return autoit.win_set_state(self.title, flag, text=self.text)
Example #3
0
def screenshotAutopsy(id):
    global wantedWindow
    global autopsyProcessId
    autopsyProcessId = psutil.Process(id)
    EnumWindows = ctypes.windll.user32.EnumWindows
    EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool,
                                         ctypes.POINTER(ctypes.c_int),
                                         ctypes.POINTER(ctypes.c_int))

    EnumWindows(EnumWindowsProc(foreach_window), 0)
    if wantedWindow is None:
        print("Plz notify admin that autopsy GUI is down")
    else:
        autoit.win_activate(wantedWindow)
        autoit.win_set_state(wantedWindow, flag=autoit.properties.SW_MAXIMIZE)
        autoit.send("!{h}", 0)
        autoit.send("{DOWN}")
        autoit.send("{DOWN}")
        autoit.send("{ENTER}")
        time.sleep(0.5)
        pyautogui.screenshot("miscellaneous/autopsy.png")
        autoit.send("{ESC}")
Example #4
0
	def setState(self, flag):
		"""显示,最小化,最大化,还原窗口"""
		return autoit.win_set_state(self.title, flag, text=self.text)