8

I am trying to launch chrome browser with a single tab window using this c# code:

Process process = new Process();
process.StartInfo.FileName = "chrome";
process.StartInfo.Arguments = url + " --new-window --window-size=640,480";
process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
process.Start();

The new window opens, but the size does not correspond to the size I passed along as argument. Does the command line switch of chrome "--window-size=x,y" not work?

Is there a different method available for this purpose.

Samuel
  • 18,286
  • 18
  • 52
  • 88
System
  • 181
  • 1
  • 3

1 Answers1

3

Looks like there is a know bug in chrome commandline switch.

Ref: http://www.ericdlarson.com/misc/chrome_command_line_flags.html "... Start the browser maximized, regardless of any previous settings. TODO(pjohnson): Remove this once bug 1137420 is fixed. We are using this as a workaround for not being able to use moveTo and resizeTo on a top-level window. --start-maximized ..."

One of the workaround that I can think of is as suggested by sorpigal using cmdow. Set The Window Position of an application via command line

Community
  • 1
  • 1
Jags
  • 105
  • 1
  • 1
  • 7