简体   繁体   中英

Open url in new IE window and not maximized?

We have a Windows Form that needs to open a browser window with a specific url. I use something like this to open the browser:

Process.Start("IExplore.exe", "http://example.com");

It works great since it opens a new browser window instead of just a tab. The issue now is that the browser window always opens in maximized form, so the app is not displayed anymore.

Is it possible to open IE so that it doesn't show as being maximized? That way, the user can see both the browser and the app.

Thanks.

I think you have to use something like:

void OpenWithStartInfo()
{
    ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
    startInfo.WindowStyle = ProcessWindowStyle.Minimized;

    startInfo.Arguments = "www.northwindtraders.com";

    Process.Start(startInfo);
}

For more info, you can check this link

ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;

Process.Start(startInfo);

If that isn't what you are looking for...

Try reading this link from Microsoft. It allows you to resize a process's window size - https://msdn.microsoft.com/en-us/library/ms633545.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM