Jump to content

Recommended Posts

Posted

I try to open ms edge maximized with a link to a website with this command:

ShellExecute("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe","https://www.autoitscript.com/site/autoit/",@ScriptDir,Default,@SW_MAXIMIZE)

But if edge was closed before in a none maximized situation it does not start maximized again.

I know i can maximize it with the following commands

WinWaitActive($title)
WinSetState($title,"",@SW_MAXIMIZE)

But why does it not start maximized with ShellExecute as expected?

Regards

Sascha

Posted (edited)
ShellExecute("https://www.autoitscript.com/forum/topic/210016-shellexecute-maximized/", "", "", "", @SW_MAXIMIZE)

 

Edit:
and if it is not the default browser the edge

ShellExecute("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", "https://www.autoitscript.com/forum/topic/210016-shellexecute-maximized/", "", "",  @SW_MAXIMIZE)

 

Edited by ioa747
UpDate

I know that I know nothing

Posted

@ioa747

Does not work for me.  Edge does not start maximized.  I even tried to use @SW_MINIMIZE and the Browser still starts with the size it was closed the last time used it.

Posted (edited)

Hi @Sascha,

the suggestion of @ioa747 works fine in my case. Maybe you did (unintended) regedit settings in the past which lead to this behavior?
Anyways, you can also add the parameter --start-maximized to your msedge.exe call which should enfore edge to open up maximized.

Best regards
Sven

Edited by SOLVE-SMART

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted

@SOLVE-SMART

I have no idea if there are any registry changes because of company policies.

But even Win-R  with "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --start-maximized  does not open edge maximized so this may be.

I think i have to live with WinSetState.

Thank you both for your help.

Regards

Sascha

Posted

Wow. That works.

Edge now allways starts up maximized when running from my script and it starts up with the last used size when starting from the icon.

Thank you @ioa747

Regards

Sascha

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...