electron wintab
node-gyp 、python2.7
1. cnpm install electron@10.1.3
cnpm install trtc-electron-sdk@latest --
2 npm install ffi-napi 出错,再装
3. npm install ref-napi
4.npm start 出错 npm cnpm install electron@10.1.3
5.开始卡 ?怎么解决ipc 同步返回值?
main:
win.hookWindowMessage(0x7FF0, function msg_callback (wParam ,lParam ) {
win.send('WT_PACKET', wParam)
})
modtab:
const myWintab32 = new ffi.Library('Wintab32', {
'WTInfoW':
['uint', ['uint', 'uint', 'pointer']],//LOGCONTEXTWptr
//UINT API WTInfoW(UINT, UINT, LPVOID);
'WTOpenW':
['uint', ['uint','pointer', 'int']],//LOGCONTEXTWptr
//HCTX API WTOpenW(HWND, LPLOGCONTEXTW, BOOL);
'WTPacketsGet':
['int', ['uint','int', 'pointer']],
// int API WTPacketsGet(HCTX, int, LPVOID);
});
1 buffer node js 两个 用的是node的buffer
2
const ffi = require('ffi-napi');
const ref = require('ref-napi')
//var StructType = require('ref-struct-di')(ref)
//var ArrayType = require('ref-array-di')(ref)
//const { ipcRenderer } = require('electron')
3 不用 struct-di ,直接pointer硬解
Node.js 使用 FFI 调用 win32 API
http://blog.mangege.com/tech/2019/12/26/1.html
Electron9.x +vue+ffi-napi 调用Dll动态链接库
https://www.jianshu.com/p/dd9463dead8c
ref-napi
https://www.npmjs.com/package/ref-napi
electron教程(三): 使用ffi-napi引入C++的dll
https://www.cnblogs.com/silenzio/p/11606389.html
node-ffi-napi
https://github.com/node-ffi-napi
nodejs/node-gyp
https://github.com/nodejs/node-gyp#installation
C++ 插件
http://nodejs.cn/api/addons.html
wacom doc
https://developer-docs.wacom.com/intuos-cintiq-business-tablets/docs/wintab-reference