I want to write a program, preferably in Python, that will change the window size of any particular application I have open. E.g. say I have Notepad open and wish to make it 640x400 - my script would recognise the window and change its dimensions automatically.
Is there an available framework in Python for this or do I need to use another language?
Press Alt + Space shortcut keys together on the keyboard to open the window menu. Now, press S. The mouse cursor will turn into a cross with arrows. Use the left, right, up and down arrow keys to resize your window.
The resizeTo() method resizes a window to a new width and height.
import pygetwindow
win = pygetwindow.getWindowsWithTitle('Notepad')[0]
win.size = (640, 400)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With