0

Hi,

I wonder if there is any syntax that can detect if any Browserwindow is open on the computer and then close this/these windows.

I use Firefox and then would want to detect if any Firefox browserwindow is opened and then close them if any is open.

Thank you!

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Lukezzz
0

Usually, one would get the list of applications running and check if a particular application is in the list. In your case, you may want to check whether "firefox.exe" is running (or any other browsers). Once detected, kill the process and the browser will close.

NOTE: It may be too invasive to forcefully close the browser. It is better to prompt user to close it before proceeding.

0

I have started an instance like this and how would it be possible to programatically close this instance that was opened ?

Process::Start("Firefox.exe", "http://www.google.com");

Thanks...

Usually, one would get the list of applications running and check if a particular application is in the list. In your case, you may want to check whether "firefox.exe" is running (or any other browsers). Once detected, kill the process and the browser will close.

NOTE: It may be too invasive to forcefully close the browser. It is better to prompt user to close it before proceeding.

Edited by Lukezzz: n/a

0

I think I am looking after this method where I will start a process and detect this opened process and kill() it but something with this code is not correct ?

I get this error:
(string, string) cannot be accessed with an instance reference; qualify it with a type name instead

Process^ myProcess = gcnew Process();
            myProcess->Start("Firefox.exe", "http://www.google.com");


            myProcess->Kill();

Edited by Lukezzz: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.