Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Windows
Hi,
 
I am launching an application from a browser which performs a particular task. In firefox app is launched through firefox plugin written in javascript. In IE BHO does this task.
 
I need to kill my application when browser is closed
Posted 27-Mar-12 1:43am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

See if this[^] can help.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 
Since you are doing this from a web browser helper object you should consider doing this with a job object. It allows you to put security restrictions on the child process that would otherwise not be available.
 
The best way to do this is to use the CreateJobObject function[^] and create a job object within the browser. Then you could call the AssignProcessToJobObject function[^] and assign the child process to the job. To have the child process close when the parent terminates... you would call the SetInformationJobObject function[^] with the JobObjectInfoClass of JobObjectBasicLimitInformation and pass a JOBOBJECT_EXTENDED_LIMIT_INFORMATION structure[^] with the LimitFlags containing the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE bits set. You can prevent additional processes from being created by setting the JOB_OBJECT_LIMIT_ACTIVE_PROCESS bits and populating the JOBOBJECT_BASIC_LIMIT_INFORMATION.ActiveProcessLimit member
 
Best Wishes,
-David Delaune
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 337
1 DamithSL 310
2 OriginalGriff 220
3 Zoltán Zörgő 149
4 Peter Leow 115
0 OriginalGriff 7,510
1 DamithSL 5,519
2 Sergey Alexandrovich Kryukov 5,044
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 27 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100