Python win32con.SW_RESTORE Examples

The following are 7 code examples of win32con.SW_RESTORE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module win32con , or try the search function .
Example #1
Source File: steam.py    From Yugioh-bot with MIT License 14 votes vote down vote up
def tap(self, x, y):
        if self.run_time.stop:
            return
        x, y = int(x), int(y)
        self.root.debug("Tapping at location ({},{})".format(x, y))
        if self._debug:
            # Helper to debug taps
            input("waiting for confirmation press enter")
        ox, oy = win32api.GetCursorPos()
        curr_window = win32gui.GetForegroundWindow()
        win32gui.ShowWindow(self.win_handle, win32con.SW_RESTORE)
        x, y = int(x), int(y)
        cx, cy = win32gui.ClientToScreen(self.win_handle, (x, y))
        x, y = self.__calculate_absolute_coordinates__(cx, cy)
        win32api.mouse_event(win32con.MOUSEEVENTF_MOVE | win32con.MOUSEEVENTF_ABSOLUTE,
                             x, y, 0, 0)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
        time.sleep(20 / 1000)
        win32api.SetCursorPos((ox, oy))
        win32gui.SetActiveWindow(curr_window) 
Example #2
Source File: window.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def AutoRestore(self):
		"If the window is minimised or maximised, restore it."
		p = self.GetWindowPlacement()
		if p[1]==win32con.SW_MINIMIZE or p[1]==win32con.SW_SHOWMINIMIZED:
			self.SetWindowPlacement(p[0], win32con.SW_RESTORE, p[2], p[3], p[4]) 
Example #3
Source File: intpyapp.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def Activate(self):
		# Bring to the foreground.  Mainly used when another app starts up, it asks
		# this one to activate itself, then it terminates.
		frame = win32ui.GetMainFrame()
		frame.SetForegroundWindow()
		if frame.GetWindowPlacement()[1]==win32con.SW_SHOWMINIMIZED:
			frame.ShowWindow(win32con.SW_RESTORE) 
Example #4
Source File: rescaletime.py    From cross3d with MIT License 5 votes vote down vote up
def restoreWindows(self):
		for hwnd in self.minimzedWindows:
			ShowWindow( hwnd, win32con.SW_RESTORE )
		self.minimzedWindows = [] 
Example #5
Source File: rescaletime.py    From cross3d with MIT License 5 votes vote down vote up
def finishScaling(self):
		if self.useTimers:
			self.scaleTimeFinished.emit(self.endTimeValue)
			if self.restoreMaxWindow:
				ShowWindow( GetWindowHandle(), win32con.SW_RESTORE )
			mxs.setArrowCursor()
			if self.uiWarningWND:
				QTimer.singleShot(1000, self.uiWarningWND.close)
		self.useTimers = False 
Example #6
Source File: main.py    From MouseTracks with GNU General Public License v3.0 5 votes vote down vote up
def restore(self):
        """Restore a window from being minimised."""
        win32gui.ShowWindow(self.hwnd, win32con.SW_RESTORE) 
Example #7
Source File: winguiauto.py    From pyAutoTrading with GNU General Public License v2.0 5 votes vote down vote up
def restoreFocusWindow(hwnd):
    win32gui.ShowWindow(hwnd, win32con.SW_RESTORE)
    win32gui.SetForegroundWindow(hwnd)
    time.sleep(0.2)