I think node-ffi will help you. It's simple and it's works.
npm install ffi
var FFI = require('ffi');
function TEXT(text){
return new Buffer(text, 'ucs2').toString('binary');
}
var user32 = new FFI.Library('user32', {
'MessageBoxW': [
'int32', [ 'int32', 'string', 'string', 'int32' ]
]
});
var OK_or_Cancel = user32.MessageBoxW(
0, TEXT('I am Node.JS!'), TEXT('Hello, World!'), 1
);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…