I am using COM4J to generate MS Office documents, but some times a process stop working.
I would like to know if there is a way to identify a PID of a application created using COM4J.
With the process id, I will kill the process that is blocking my queue.
import com4j.Variant;
import word._Application;
import word._Document;
public class WordDemo {
public static void main(String[] args) {
_Application app = word.ClassFactory.createApplication();
app.visible(true);
Integer pid = null
//Integer pid = app.getProcessID();
app.documents().add( Variant.getMissing(), false, false, true);
app.selection().typeText("Welcome to com4j");
app.selection().typeParagraph();
app.selection().typeText("Your Java/COM bridging solution");
System.out.println("Process ID # " + pid)
}
}