Jump to content

Firefox and ProcessClose through Process ID


Recommended Posts

Does anyone know how to close a Firefox window through a ProcessID? I'm having trouble using ProcessClose($pID). $pID is retrieved through running Firefox on the run command.

Edited by Tostones
Link to comment
Share on other sites

Does anyone know how to close a Firefox window through a ProcessID? I'm having trouble using ProcessClose($pID). $pID is retrieved through running Firefox on the run command.

Get the window handle instead and use WinClose().

The process ID for Firefox.exe only continues for the first instance run. The second, third, etc., time you run Firefox the new instance only exits long enough to tell the first instance to open another window. This takes milliseconds, and then the new process ends, leaving the first one with an additional window. The new PID doesn't exist very long, and if you kill the first one, it closes ALL the Firefox windows.

You can safely close individual Firefox windows without hurting others. The most reliable way is by the handle.

muttley

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Get the window handle instead and use WinClose().

The process ID for Firefox.exe only continues for the first instance run. The second, third, etc., time you run Firefox the new instance only exits long enough to tell the first instance to open another window. This takes milliseconds, and then the new process ends, leaving the first one with an additional window. The new PID doesn't exist very long, and if you kill the first one, it closes ALL the Firefox windows.

You can safely close individual Firefox windows without hurting others. The most reliable way is by the handle.

muttley

Thanks, I tried it via handle and it works.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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