How to open a chrome window from command line AND bring it to front?

4,765 views
Skip to first unread message

Peter Bulyaki

unread,
Jun 10, 2015, 10:17:41 AM6/10/15
to chromium...@chromium.org
Hi Guys,

I am a software engineer and I am working on a windows application. This application uses CreateProcessAsUser to execute Chrome (or whatever the default browser is) with a URL as an argument.
The chrome window that is opened is not brought to front. This is my main problem. I have tried the --new-window switch, but that does not bring the window to front either. Is there any way to achieve this?

I have found the following question with no answers:
The link in the only answer does not work, and the topic is locked.

Can anyone tell me if this is possible at all?

Thanks:
Peter

PhistucK

unread,
Jun 10, 2015, 11:15:26 AM6/10/15
to peter....@gmail.com, Chromium-discuss
Have you tried your way on another computer?
Start > Run...
c:\Program Files (x86)\google\chrome\Application\chrome.exe http://g.co/
For example, brings it to the front.
Same with -
Start > Run...



PhistucK

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

Peter Bulyaki

unread,
Jun 10, 2015, 11:24:05 AM6/10/15
to chromium...@chromium.org, peter....@gmail.com
Thanks but please read the post itself too next time, not just the title. What you suggested does not answer my question.
I already have a working solution that executes the default browser with a URL in the arguments. This is not my problem. My problem is that I would like to bring it to front. If you execute it through CreateProcess, it does not bring it to front. ShellExecute would bring it to front (I guess) but I can't use that. That is why I need a command line switch.

Peter

PhistucK

unread,
Jun 10, 2015, 11:34:29 AM6/10/15
to peter....@gmail.com, Chromium-discuss
Does CreateProcess bring any application to the front (not Chrome)?


PhistucK

Peter Bulyaki

unread,
Jun 10, 2015, 11:38:09 AM6/10/15
to chromium...@chromium.org, peter....@gmail.com
No, it does not. This is why I need a command line switch to Chrome, that tells Chrome to come to front. Just like it is doable with firefox and IE.

Peter

PhistucK

unread,
Jun 10, 2015, 11:40:24 AM6/10/15
to peter....@gmail.com, Chromium-discuss
I do not think such command line flag exists.


PhistucK

Peter Bulyaki

unread,
Jun 10, 2015, 11:43:41 AM6/10/15
to chromium...@chromium.org, peter....@gmail.com
Thanks for that. A 'not possible' answer is an answer, saves me time.
I have searched through the command line switches of Chrome already and could not find it myself either.
I was hoping someone here maybe knows a commandline switch that at least has this as a side-effect.

Thanks anyway.
Reply all
Reply to author
Forward
0 new messages