【发布时间】:2015-12-17 11:13:17
【问题描述】:
我有一个 dll,我想从 Thunderbird 运行它并获得一个返回值。 是否有一个扩展已经做到了?
谢谢 阿尔伯
【问题讨论】:
标签: thunderbird
我有一个 dll,我想从 Thunderbird 运行它并获得一个返回值。 是否有一个扩展已经做到了?
谢谢 阿尔伯
【问题讨论】:
标签: thunderbird
你可以使用 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。
【讨论】: