Python win32con.SW_MAXIMIZE Examples

The following are 5 code examples of win32con.SW_MAXIMIZE(). 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: rescaletime.py    From cross3d with MIT License 5 votes vote down vote up
def maximizeMax(self):
		"""
			Maximize max to ensure that the Time Configuration button is on the monitor and clickable, and to 
			ensure that the dialogs will be on screen.
		"""
		self.restoreMaxWindow = False
		maxHwnd = GetWindowHandle()
		if GetWindowPlacement(maxHwnd)[1] == win32con.SW_SHOWNORMAL:
			ShowWindow( maxHwnd, win32con.SW_MAXIMIZE )
			self.restoreMaxWindow = True
			QTimer.singleShot(self.timerDelay, self.mouseToTimeButton)
			return
		self.mouseToTimeButton() 
Example #2
Source File: mcplatform.py    From GDMC with ISC License 5 votes vote down vote up
def get_state(self):
        """Return wheter the window is maximized or not, or minimized or full screen."""
        flags, state, ptMin, ptMax, rect = win32gui.GetWindowPlacement(self.base_handler_id)
        if DEBUG_WM:
            print "state", state
        if state == win32con.SW_MAXIMIZE:
            return MAXIMIZED
        elif state == win32con.SW_MINIMIZE:
            return MINIMIZED
        return NORMAL 
Example #3
Source File: mcplatform.py    From MCEdit-Unified with ISC License 5 votes vote down vote up
def get_state(self):
        """Return wheter the window is maximized or not, or minimized or full screen."""
        flags, state, ptMin, ptMax, rect = win32gui.GetWindowPlacement(self.base_handler_id)
        if DEBUG_WM:
            print "state", state
        if state == win32con.SW_MAXIMIZE:
            return MAXIMIZED
        elif state == win32con.SW_MINIMIZE:
            return MINIMIZED
        return NORMAL 
Example #4
Source File: mcplatform.py    From GDMC with ISC License 4 votes vote down vote up
def set_state(self, state=NORMAL, size=(-1, -1), pos=(-1, -1), update=True):
        """Set wheter the window is maximized or not, or minimized or full screen.
        If no argument is given, assume the state will be windowed and not maximized.
        If arguments are given, only the first is relevant. The other ones are ignored.

        ** Only maximized and normal states are implemented for now. **

        :state: valid arguments:
        'minimized', MINIMIZED, 0.
        'normal', NORMAL, 1: windowed, not maximized.
        'maximized', MAXIMIZED, 2.
        'fullscreen, FULLSCREEN, 3.

        :size: list, tuple: the new size; if (-1, -1) self.get_size() is used.
               If one element is -1 it is replaced by the corresponding valur from self.get_size().
        :pos: list, tuple: the new position; if (-1, -1), self.get_position is used.
              If one element is -1 it is replaced by the corresponding valur from self.get_position().
        :update: bool: whether to call the internal flush method."""
        if state not in (0, MINIMIZED, 'minimized', 1, NORMAL, 'normal', 2, MAXIMIZED, 'maximized', 3, FULLSCREEN, 'fullscreen'):
            # Raise a value error.
            raise ValueError, "Invalid state argument: %s is not a correct value" % state
        if type(size) not in (list, tuple):
            raise TypeError, "Invalid size argument: %s is not a list or a tuple."
        if type(pos) not in (list, tuple):
            raise TypeError, "Invalid pos argument: %s is not a list or a tuple."

        if state in (1, NORMAL, 'normal'):
            size = list(size)
            sz = self.get_size()
            if size[0] == -1:
                size[0] = sz[0]
            if size[1] == -1:
                size[1] = sz[1]
            pos = list(pos)
            ps = self.get_position()
            if pos[0] == -1:
                pos[0] = ps[0]
            if pos[1] == -1:
                pos[1] = ps[1]
            self.set_mode(size, self.mode)
            self.set_position(pos)
        elif state in (0, MINIMIZED, 'minimized'):
            pass
        elif state in (2, MAXIMIZED, 'maximized'):
            win32gui.ShowWindow(self.base_handler_id, win32con.SW_MAXIMIZE)
        elif state in (3, FULLSCREEN, 'fullscreen'):
            pass 
Example #5
Source File: mcplatform.py    From MCEdit-Unified with ISC License 4 votes vote down vote up
def set_state(self, state=NORMAL, size=(-1, -1), pos=(-1, -1), update=True):
        """Set wheter the window is maximized or not, or minimized or full screen.
        If no argument is given, assume the state will be windowed and not maximized.
        If arguments are given, only the first is relevant. The other ones are ignored.

        ** Only maximized and normal states are implemented for now. **

        :state: valid arguments:
        'minimized', MINIMIZED, 0.
        'normal', NORMAL, 1: windowed, not maximized.
        'maximized', MAXIMIZED, 2.
        'fullscreen, FULLSCREEN, 3.

        :size: list, tuple: the new size; if (-1, -1) self.get_size() is used.
               If one element is -1 it is replaced by the corresponding valur from self.get_size().
        :pos: list, tuple: the new position; if (-1, -1), self.get_position is used.
              If one element is -1 it is replaced by the corresponding valur from self.get_position().
        :update: bool: whether to call the internal flush method."""
        if state not in (0, MINIMIZED, 'minimized', 1, NORMAL, 'normal', 2, MAXIMIZED, 'maximized', 3, FULLSCREEN, 'fullscreen'):
            # Raise a value error.
            raise ValueError("Invalid state argument: %s is not a correct value" % state)
        if not isinstance(size, (list, tuple)):
            raise TypeError("Invalid size argument: %s is not a list or a tuple.")
        if not isinstance(pos, (list, tuple)):
            raise TypeError("Invalid pos argument: %s is not a list or a tuple.")

        if state in (1, NORMAL, 'normal'):
            size = list(size)
            sz = self.get_size()
            if size[0] == -1:
                size[0] = sz[0]
            if size[1] == -1:
                size[1] = sz[1]
            pos = list(pos)
            ps = self.get_position()
            if pos[0] == -1:
                pos[0] = ps[0]
            if pos[1] == -1:
                pos[1] = ps[1]
            self.set_mode(size, self.mode)
            self.set_position(pos)
        elif state in (0, MINIMIZED, 'minimized'):
            pass
        elif state in (2, MAXIMIZED, 'maximized'):
            win32gui.ShowWindow(self.base_handler_id, win32con.SW_MAXIMIZE)
        elif state in (3, FULLSCREEN, 'fullscreen'):
            pass