Sapui5 使用Jacob标识多个sap窗口会话

Sapui5 使用Jacob标识多个sap窗口会话,sapui5,jacob,Sapui5,Jacob,当多个SAP应用程序窗口打开时,是否有办法使用Jacob识别这些SAP会话 我目前正在使用以下代码块来识别会话,并且它在只有一个SAP窗口打开时工作 public ActiveXComponent getSapSession() { ComThread.InitSTA(); this.SAPROTWr = new ActiveXComponent("SapROTWr.SapROTWrapper"); try { this.ROTEnt

当多个SAP应用程序窗口打开时,是否有办法使用Jacob识别这些SAP会话

我目前正在使用以下代码块来识别会话,并且它在只有一个SAP窗口打开时工作

public ActiveXComponent getSapSession() {
    ComThread.InitSTA();
    this.SAPROTWr = new ActiveXComponent("SapROTWr.SapROTWrapper");

    try {
        this.ROTEntry = this.SAPROTWr.invoke("GetROTEntry", "SAPGUI").toDispatch();
        this.ScriptEngine = Dispatch.call(this.ROTEntry, "GetScriptingEngine");
        this.GUIApp = new ActiveXComponent(this.ScriptEngine.toDispatch());
        this.Connection = new ActiveXComponent(this.GUIApp.invoke("Children", 0).toDispatch());
        this.Session = new ActiveXComponent(this.Connection.invoke("Children", 0).toDispatch());
    } catch (Exception var2) {
        System.out.println(var2.getMessage().toString());
    }
    return this.Session;
}
在多个SAP窗口打开的情况下,Jacob是否能够唯一地识别这些窗口

如果是的话,我们怎么做?感谢你的回答