Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open an application with its window maximized?

Tags:

python

windows

import os
import win32gui, win32con

class Path:
   pass

path1 = os.popen(r"C:\Windows\notepad.exe")

Once the notepad is open, it should appear with full screen(maximize window).

like image 969
vinod sagar Avatar asked Oct 15 '25 04:10

vinod sagar


1 Answers

You can use Windows's start command with a /max modifier, i.e.:

import subprocess

subprocess.call(["cmd", "/c", "start", "/max", "C:\\Windows\\notepad.exe"])
like image 110
zwer Avatar answered Oct 17 '25 17:10

zwer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!