【问题标题】:How to run a dll from Thunderbird and get a return value如何从 Thunderbird 运行 dll 并获取返回值
【发布时间】:2015-12-17 11:13:17
【问题描述】:

我有一个 dll,我想从 Thunderbird 运行它并获得一个返回值。 是否有一个扩展已经做到了?

谢谢 阿尔伯

【问题讨论】:

    标签: thunderbird


    【解决方案1】:

    你可以使用 js-ctypes 来做到这一点。以下是来自 MDN 的示例:

    Components.utils.import("resource://gre/modules/ctypes.jsm");
    
    var lib = ctypes.open("C:\\WINDOWS\\system32\\user32.dll");
    
    /* Declare the signature of the function we are going to call */
    var msgBox = lib.declare("MessageBoxW",
                             ctypes.winapi_abi,
                             ctypes.int32_t,
                             ctypes.int32_t,
                             ctypes.jschar.ptr,
                             ctypes.jschar.ptr,
                             ctypes.int32_t);
    var MB_OK = 0;
    
    var ret = msgBox(0, "Hello world", "title", MB_OK);
    
    lib.close();
    

    有关更多详细信息和示例,请参阅https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes

    【讨论】:

    • 您好,我会按照您的建议进行尝试。非常感谢您的帮助
    猜你喜欢
    • 1970-01-01
    • 2011-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多