[Question] How to get the process ID of the new activeXObject ?
Hi,
When there are 2 processes running with the same name how can I get the PID for each ?
var proc1 = new ActiveXObject("PowerPoint.Application");
var proc2 = new ActiveXObject("PowerPoint.Application");
So far I tried proc1.Quit(); but it doesn't works some time so I would like to get the PId and then call "taskkill /F /T /PID " + proc1.pid
PID value is unknown, calling WinAPI CoCreateInstance does not give this. You need to free all links to each object and variant from this context.
пт, 23 авг. 2019 г. в 15:23, Taxman972 [email protected]:
Hi,
When there are 2 processes running with the same name how can I get the PID for each ?
var proc1 = new ActiveXObject("PowerPoint.Application"); var proc2 = new ActiveXObject("PowerPoint.Application");
So far I tried proc1.Quit(); but it doesn't works some time so I would like to get the PId and then call "taskkill /F /T /PID " + proc1.pid
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/durs/node-activex/issues/53?email_source=notifications&email_token=AAEMMNPTZUMKU5XNMTBK7DDQF7JCXA5CNFSM4IO7CH4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HHA5MRQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEMMNNGASZP43OHMEOONHTQF7JCXANCNFSM4IO7CH4A .
You need to free all links to each object and variant from this context.
Do you mean winax.release(proc1) ?
Cause that doesn't works either.
var App = new winax.Object("PowerPoint.Application");
var Docs = App.Presentations;
var Doc = Docs.Open("full/path/to/powerpointFile.ppt");
Doc.Save();
Doc.Close();
App.Quit();
winax.release(App, Docs, Doc);
With this code the PowerPoint process is still running.
Is there a solution to this? (have the same Problem)
I am having the same problem releasing my dlls as well.
let ffi = require('ffi-napi'),
ref = require('ref-napi'),lpdwordPtr = ref.refType(ref.types.ulong),
user32 = ffi.Library('user32', {GetWindowThreadProcessId: ['int', ['int', lpdwordPtr]]}),
pid = ref.alloc(lpdwordPtr);
function killHwnd(Hwnd) {
user32.GetWindowThreadProcessId(Hwnd, pid);
try { process.kill(pid.readInt32LE(0)) } catch (e) {
console.warn('process.kill', e);
}
}
killHwnd(proc1.hwnd);
killHwnd(proc2.hwnd);