使用 Jacob 识别多个 sap 窗口会话

问题描述

当多个 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 是否能够唯一地识别这些窗口?

如果是这样,我们该怎么做?感谢您的回答。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)