Kalmat / PyWinCtl

Cross-Platform module to get info on and control windows on screen
Other
179 stars 19 forks source link

resizeTo function not working when chrome maximized #48

Closed ManabBala closed 1 year ago

ManabBala commented 1 year ago

when chrome is maximized the resizeTo function does not working for me. if not maximized working just fine.

chrome version: 109.0.5414.121 (Official Build) (64-bit)

Edition Windows 10 Pro Version 22H2 Installed on ‎12-‎05-‎2022 OS build 19045.2546 Experience Windows Feature Experience Pack 120.2212.4190.0

Kalmat commented 1 year ago

Hi! Thank you for your feedback!

I guess that's the expected behavior. I mean, if a window is maximized, it shouldn't be possible to resize it. In case you want to force resizing the window, you can do this:

import pywinctl as pwc

win = pwc.getActiveWindow()
if win.isMaximized:
    win.restore()
win.resizeTo(800, 600)

Let me know if this works for you.

ManabBala commented 1 year ago

Hi! Thank you for your feedback!

I guess that's the expected behavior. I mean, if a window is maximized, it shouldn't be possible to resize it. In case you want to force resizing the window, you can do this:

import pywinctl as pwc

win = pwc.getActiveWindow()
if win.isMaximized:
    win.restore()
win.resizeTo(800, 600)

Let me know if this works for you.

Working just fine... Thank you so much. was using pyautogui for restoring...LOL..😁